users@jax-rs-spec.java.net

[jax-rs-spec users] Re: HTTP PATCH on the client

From: Daniel Kulp <dkulp_at_apache.org>
Date: Thu, 13 Apr 2017 12:50:56 -0400

CXF uses the HttpUrlConnection, but we use a bit of “reflection magic” to dig into the connection to force it to work with PATCH. It’s ugly and fragile and will likely not work with various security managers and such. However, it “mostly works” ok.

As a backup, CXF can also use the Apache HttpClient, that’s just more dependencies.

Dan



> On Apr 13, 2017, at 10:13 AM, Pavel Bucek <pavel.bucek_at_oracle.com> wrote:
>
> Dear experts,
>
> as you might know, we recently introduced support for @PATCH and corresponding methods in the Client part of the API.
>
> There is one catch - HttpUrlConnection doesn't support making PATCH requests.
>
> Its known JDK issue and it won't be fixed. HttpUrlConnection was supposed to be replaced by HttpClient in Java SE 9, but .. that won't happen and it wouldn't fix our issue, since JAX-RS 2.1 implementation is stuck on Java SE 8 for now.
>
> That doesn't mean PATCH on the client cannot be implemented, the only issue is that the implementation would need to use something else than HttpUrlConnection, implying that there must be some other HTTP (client side) framework involved, or it could be re-implemented using standard Java networking API.
>
> Jersey already has some means how to overcome that limitation, but by default we still do use HttpUrlConnection.
>
> Sergey, what about CXF? Do you use HttpUrlConnection on the client side?
>
> Does anyone else know how is this handled in other implementations?
>
> We still could support @PATCH on the server side without having it on the client, so dropping that part is certainly an option, but we'd like to hear your thoughts.
>
> Thanks and regards,
> Pavel
>

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com