Skip to content
Browse files

Content type was not set on StringEntity's

  • Loading branch information...
1 parent 68e97fc commit cf807b1634b010a675b47d7570515708cccad0a2 @wmathurin wmathurin committed Apr 25, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 native/SalesforceSDK/src/com/salesforce/androidsdk/rest/RestRequest.java
View
13 native/SalesforceSDK/src/com/salesforce/androidsdk/rest/RestRequest.java
@@ -59,7 +59,7 @@
*
*/
public class RestRequest {
-
+
/**
* Enumeration for all HTTP methods.
*
@@ -357,8 +357,13 @@ public static RestRequest getRequestForQuery(String apiVersion, String q) throws
*/
private static StringEntity prepareFieldsData(Map<String, Object> fields)
throws UnsupportedEncodingException {
- return (fields == null ? null : new StringEntity(new JSONObject(fields).toString(), HTTP.UTF_8));
+ if (fields == null) {
+ return null;
+ }
+ else {
+ StringEntity entity = new StringEntity(new JSONObject(fields).toString(), HTTP.UTF_8);
+ entity.setContentType("application/json");
+ return entity;
+ }
}
-
-
}

1 comment on commit cf807b1

@wmathurin

This should fix the 6 tests currently failing in SalesforceSDKTest

Please sign in to comment.
Something went wrong with that request. Please try again.