Skip to content

Commit a1ad31c

Browse files
committed
DELETE request with params, Fixed android-async-http#259
1 parent 43b39f5 commit a1ad31c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

library/src/com/loopj/android/http/AsyncHttpClient.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,21 @@ public void delete(Context context, String url, Header[] headers, AsyncHttpRespo
683683
sendRequest(httpClient, httpContext, delete, null, responseHandler, context);
684684
}
685685

686+
/**
687+
* Perform a HTTP DELETE request.
688+
*
689+
* @param context the Android Context which initiated the request.
690+
* @param url the URL to send the request to.
691+
* @param headers set one-time headers for this request
692+
* @param params additional DELETE parameters or files to send along with request
693+
* @param responseHandler the response handler instance that should handle the response.
694+
*/
695+
public void delete(Context context, String url, Header[] headers, RequestParams params, AsyncHttpResponseHandler responseHandler) {
696+
HttpDelete httpDelete = new HttpDelete(getUrlWithQueryString(url, params));
697+
if(headers != null) httpDelete.setHeaders(headers);
698+
sendRequest(httpClient, httpContext, httpDelete, null, responseHandler, context);
699+
}
700+
686701

687702
// Private stuff
688703
protected void sendRequest(DefaultHttpClient client, HttpContext httpContext, HttpUriRequest uriRequest, String contentType, AsyncHttpResponseHandler responseHandler, Context context) {

0 commit comments

Comments
 (0)