Closed
Description
openedon Dec 14, 2015
We got a server that only accepts Content-Type: application/json and not Content-Type: application/json; charset=utf-8;
OkHttp keeps generating application/json; charset=utf-8; when we do the following json post
MediaType type = MediaType.parse("application/json");
String json = "{"APIRequests"}";
Request request = new Request.Builder()
.url(apiURL)
.post(RequestBody.create(type, json))
.build();
Response response = client.newCall(request).execute();
String html = response.body().string();
and returns an error. Is there any posibility to overwrite the content-type and not use the generated one from MediaType.parse?
Server it's a public one and i do have no control over it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels