java - Jersey Client post binary data application-octet/stream -


i perform post binary data using jersey client.

the equivalent curl be:

curl -v --header "content-type:application/octet-stream" --data-binary "abc" http://example.com 

i not find how in official docs: http://jersey.java.net/documentation/latest/user-guide.html#client

thanks.

i think can invoke post request entity encapsulates binary data this:

client client = clientbuilder.newclient(); webtarget webtarget = client.target("http://example.com/rest"); response response = webtarget.request(mediatype.text_plain_type)                 .post(entity.entity("abc", mediatype.application_octet_stream)); 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -