0
我正在使用“Android异步Http客户端”(Loopj)库处理所有请求到服务器的Android应用程序。Android异步Http客户端(Loopj)带有头文件和正文的POST请求
我需要发送带有头文件和JSON正文的POST请求。
通过寻找在AsynchHttpClient.java可用的POST方法,我发现那些:
public void post(Context context, String url, Header[] headers, RequestParams params, String contentType, AsyncHttpResponseHandler responseHandler)
public void post(Context context, String url, Header[] headers, HttpEntity entity, String contentType, AsyncHttpResponseHandler responseHandler)
一个我应该使用哪一个? Header[]
,RequestParams
和HttpEntity
有什么区别? 哪一个被认为是持有标题和哪个请求的主体?
感谢任何澄清
如何在使用loopj时在发布请求中添加标题? –