Skip to content

Commit 9c7b6d4

Browse files
committed
Added HTTP OPTIONS call
1 parent ff9633e commit 9c7b6d4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import cz.msebera.android.httpclient.client.RedirectHandler;
5959
import cz.msebera.android.httpclient.client.methods.HttpEntityEnclosingRequestBase;
6060
import cz.msebera.android.httpclient.client.methods.HttpHead;
61+
import cz.msebera.android.httpclient.client.methods.HttpOptions;
6162
import cz.msebera.android.httpclient.client.methods.HttpPatch;
6263
import cz.msebera.android.httpclient.client.methods.HttpPost;
6364
import cz.msebera.android.httpclient.client.methods.HttpPut;
@@ -988,6 +989,24 @@ public void cancelRequestsByTAG(Object TAG, boolean mayInterruptIfRunning) {
988989
}
989990

990991
// [-] HTTP HEAD
992+
// [+] HTTP OPTIONS
993+
994+
/**
995+
* Perform a HTTP OPTIONS request, without any parameters.
996+
*
997+
* @param url the URL to send the request to.
998+
* @param responseHandler the response handler instance that should handle the response.
999+
* @return RequestHandle of future request process
1000+
*/
1001+
public RequestHandle options(String url, ResponseHandlerInterface responseHandler) {
1002+
return options(null, url, null, responseHandler);
1003+
}
1004+
1005+
public RequestHandle options(Context context, String url, RequestParams params, ResponseHandlerInterface responseHandler) {
1006+
return sendRequest(httpClient, httpContext, new HttpOptions(getUrlWithQueryString(isUrlEncodingEnabled(), url, params)), null, responseHandler, context);
1007+
}
1008+
1009+
// [-] HTTP OPTIONS
9911010
// [+] HTTP GET
9921011

9931012
/**

0 commit comments

Comments
 (0)