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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -