I am talking to a file upload service that accepts post data, not form data. By default, java's HttpURLConnection
sets the Content-Type
header to application/x-www-form-urlencoded
. this is obviously wrong if i'm posting pure data.
I (the client) don't know the content type. I don't want the Content-Type
header set at all. the service has a feature where it will guess at the content type (based on the file name, reading some data from the file, etc).
How do I unset a header? There's no remove header, and setting it to null
doesn't change the value and setting it to the empty string results in the header being set with no value.