I am working on an android application, I am using "Android Asynchronous Http Client" (Loopj) library in order to handle all the requests to the server.
I need to send a POST request with headers and JSON body.
By looking to the available POST methods in the AsynchHttpClient.java I found those:
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)
Which one should I use? What is the difference between Header[]
, RequestParams
and HttpEntity
?
Which one is considered to hold the headers and which the body of the request?
Thanks for any clarification