Skip to content

Commit 4da6a0f

Browse files
authored
Fix DELETE operations (#616)
1 parent f39540e commit 4da6a0f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Parse/src/main/java/com/parse/ParseOkHttpClient.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ public ParseOkHttpClient(int socketOperationTimeout, SSLSessionCache sslSessionC
117117
okHttpRequestBuilder.get();
118118
break;
119119
case DELETE:
120-
okHttpRequestBuilder.delete();
121-
break;
122120
case POST:
123121
case PUT:
124-
// Since we need to set body and method at the same time for POST and PUT, we will do it in
122+
// Since we need to set body and method at the same time for DELETE, POST, PUT, we will do it in
125123
// the following.
126124
break;
127125
default:
@@ -154,6 +152,8 @@ public ParseOkHttpClient(int socketOperationTimeout, SSLSessionCache sslSessionC
154152
case POST:
155153
okHttpRequestBuilder.post(okHttpRequestBody);
156154
break;
155+
case DELETE:
156+
okHttpRequestBuilder.delete(okHttpRequestBody);
157157
}
158158
return okHttpRequestBuilder.build();
159159
}

Parse/src/test/java/com/parse/ParseOkHttpClientTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void testGetOkHttpRequestType() throws IOException {
8282
.build();
8383
okHttpRequest = parseClient.getRequest(parseRequest);
8484
assertEquals(ParseHttpRequest.Method.DELETE.toString(), okHttpRequest.method());
85+
assertEquals(null, okHttpRequest.body());
8586

8687
// Put
8788
parseRequest = builder

0 commit comments

Comments
 (0)