On Thu, 2019-05-09 at 07:31 -0700, Ryan Bergman wrote:
> Hello,
> 
>    I am the current maintainer of the Kong/unirest-java library.
> Unirest
> has always been a simplified fluent wrapper for Apache Http Client.
> Recently with Apache Client 5 in beta I decided to start playing
> around
> with upgrading to it and I would like to provide some feedback.
> 

Please take a look at the HttpClient 5.0 migration guide. I hope it
will make things easier for you

https://ok2c.github.io/httpclient-migration-guide/

Do feel free to contribute whatever changes or fixes you may find
useful


>     1. I cannot figure out how to configure a request and execute it
> (non-async).
>         a. ClassicHttpRequest has no setConfig(RquestConfig) method

Please use HttpClientContext#setRequestConfig instead. It will work
with both classic and async variants of HttpClient. 


>         b. ConfigurableHttpRequest (and SimpleHttpRequest) do but
> CloseableHttpClient has no method to execute such a request. It looks
> like
> the ONLT way to execute one of those is through the async client?
> 

This is a bug. Please raise a JIRA for it.


> 
>     2. Similarly on the CloseableHttpAsyncClient I cannot see a way
> to get
> this to work with ClassicHttpRequest? It wants to use
> SimpleHttpRequest but
> SimpleHttpRequests don't have a way to set a more complicated Entity
> like a
> multipart form with octet-streams?
> 

ClassicHttpRequest cannot be executed in the async (non-blocking) mode.
 
Multipart form entity APIs are inherently blocking. Someone needs to
build async version of those APIs. 


>     3. SimpleHttpResponse does not handle GZIPed responses and I
> found I
> needed to uncompress the bytes myself.
> 

Async clients of all versions (4.1 and 5.0) do not support automatic
content decompression. 

>     4. The docs and examples seem to flip back and forth between new
> and
> old ways of doing things. I would be nice to have a "upgrade guide".
> I
> would be happy to help put that together once I figure out how to
> upgrade
> Unirest :)
> 

Please see 

https://ok2c.github.io/httpclient-migration-guide/


> I don't want to be totally negative, I think your new fluent
> interfaces are
> great, one of the reason folks tend to use Unirest is that it's
> "simple"
> and hides the complexity of previous versions of Http Client. I'm
> also
> super excited to be able to take advantage of HTTP/2. Keep up the
> good work!
> 

Thank you, Ryan.

Oleg


> Thanks
> Ryan Bergman (@ryber)


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to