HttpClientBuilder() should accept strings without serialization format
See original GitHub issueCurrently, 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:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll go ahead and close this issue since the reported behavior seems reasonable, though possibly too easy to get mixed up.
Oops! Got the classes mixed up in my head 😦 I went from
HttpClient
toClientBuilder
instead ofHttpClientBuilder
. I guessClientBuilder
requiring format but notHttpClientBuilder
makes sense. Though it might be worth thinking about the many ways of doing the same thing causing confusion in this case.