Skip to content

Commit

Permalink
Using StringEntity Constructor Available on Android HttpClient Version
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Dec 8, 2015
1 parent 45c7f9a commit df2ccc6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ private String postJsonAssertOkAndReturnBody(String url, String json, int expect
HttpPost post = new HttpPost(url);
try {
if (json != null) {
post.setEntity(new StringEntity(json, APPLICATION_JSON));
StringEntity stringEntity = new StringEntity(json);
stringEntity.setContentType(APPLICATION_JSON.getMimeType());
post.setEntity(stringEntity);
}
HttpResponse response = httpClient.execute(post);
int statusCode = response.getStatusLine().getStatusCode();
Expand Down

0 comments on commit df2ccc6

Please sign in to comment.