I use AsyncHttpClient to create an http POST request:
AsyncHttpClient.BoundRequestBuilder reqBuilder;
reqBuilder = httpClient.preparePost(url);
reqBuilder.setBody(data);
It sometimes doesn't send content-type header and sometimes sends it as
Content-Type: text/html; charset=ISO-8859-1
which causes our request to fail at [REST API] server side.
I am at a loss to understand why it is inconsistent.
Client is created as below:
import com.ning.http.client.*;
AsyncHttpClient httpClient = new AsyncHttpClient(
new AsyncHttpClientConfig.Builder().build());