大家好我想使用AndroidAsyncHttp将数据发布到服务器。
因为我在标题中有4个参数而在正文请求中有10个我已经完成了以下代码但是没有工作并且得到了空响应..
void callMethod()
{
AsyncHttpClient clinet = new AsyncHttpClient();
HttpPost httpPost = new HttpPost();
httpPost.setHeader("HEADERPRMNAME", "werew");
httpPost.setHeader("HEADERPRMNAME", "werweR");
httpPost.setHeader("HEADERPRMNAME", "Rwerwep");
httpPost.setHeader("HEADERPRMNAME", "werwe");
Network.Request r = new Network.Request();
clinet.addHeader("HEADERPRMNAME"werr");
clinet.addHeader("HEADERPRMNAME", "werwer");
clinet.addHeader("HEADERPRMNAME", "1223134");
clinet.addHeader("HEADERPRMNAME", "wer");
// Headers headers1=Headers.of("HEADERPRMNAME","121");
// Headers headers1=Headers.of("HEADERPRMNAME","12121212");
// Headers headers1=Headers.of("HEADERPRMNAME","werew");
RequestParams requestParams = new RequestParams();
requestParams.put("HEADERPRMNAME", 10);
requestParams.put("HEADERPRMNAME", 1);
clinet.setUserAgent("I HAVE PASSED HERE ALSO AS STRING BUT NOT WORKED");
clinet.post(ctx, "MYURL", requestParams, new TextHttpResponseHandler() {
@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
System.out.println("PPLLL" + responseString);
}
@Override
public void onSuccess(int statusCode, Header[] headers, String responseString) {
}
});
}
请帮帮我