当我使用AsyncHttpClient从我的请求URL(使用GET方法)获取响应时,它工作正常。现在我正在尝试使用AQuery库,并得到405错误。我该如何处理这个问题?我的代码:
public void queryAPI(String url, Map<String, Object> params, final ObjectCallback success, final ObjectCallback failure) {
if (params == null) {
params = new HashMap<String, Object>();
}
aq.ajax(baseUrl, params, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject data, AjaxStatus status) {
Log.e("Status", status.getCode() + " " +status.getMessage());
if (data != null)
success.process(null);
failure.process(null);
}
}.method(Constants.METHOD_GET).header("Authorization","authValue").header("User-Agent", "android"));
}