question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpClientBuilder() should accept strings without serialization format

See original GitHub issue

Currently, there are two versions of HttpClientBuilder(), one that takes a String and one that takes URI. The latter automatically prepends none+ to the URI but the former will just reject URL strings without a serialization format. It’s surprising for these two similar methods to have different accepted input - I think it’s better of the String version also automatically adds none+ when no format is specified. HttpClient.of already does this, so this is also confusing distinction between the builder and static factories.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anuraagacommented, May 16, 2018

I’ll go ahead and close this issue since the reported behavior seems reasonable, though possibly too easy to get mixed up.

1reaction
anuraagacommented, May 16, 2018

Oops! Got the classes mixed up in my head 😦 I went from HttpClient to ClientBuilder instead of HttpClientBuilder. I guess ClientBuilder requiring format but not HttpClientBuilder makes sense. Though it might be worth thinking about the many ways of doing the same thing causing confusion in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP POST using JSON in Java - Stack Overflow
Create an HttpPost request with it and add the header application/x-www-form-urlencoded; Create a StringEntity that you will pass JSON to it ...
Read more >
org.apache.http.impl.nio.client.HttpAsyncClientBuilder ...
This exception is thrown when a timeout expired on a socket read or accept operation. Arrays (java.util). This class contains various methods for...
Read more >
A Guide to the RestTemplate - Baeldung
In this tutorial, we're going to illustrate the broad range of operations where the Spring REST Client — RestTemplate — can be used, ......
Read more >
RestClientBuilder (Apache Juneau 8.1.3)
Configuration property: Binary string format. ... Returns the HttpClientBuilder that will be used to create the HttpClient used by RestClient .
Read more >
How to serialize and deserialize JSON using C# - .NET
Use the WriteIndented option to format the JSON for human readability when that is helpful. For production use, you would typically accept ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found