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
Post a Comment