After some hours research, I haven't found any solution that contains my problem.
I have a String value that I want to send it via POST.
I've build something. I just don't know how to set that it will be send as binary/octet-stream.
String data = someData();
String sUrl = "http://some.example.website.com";
URL url = new URL(sUrl);
HttpURLConnection connection = (HttpURLConnection) (new URL(sUrl)).openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setDoInput(true);
connection.connect();
I'm using HttpUrlConnection because I used DefaultHttpClient() that is deprecated.
I hope someone can help me!
Kind Regards!