Regarding to LoopJ AndroidAsyncHttp examples I make a get request like this:
final TextView text = (TextView) findViewById(R.id.textView);
AsyncHttpClient client = new AsyncHttpClient();
client.get("http://example.com/mypage/", new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
text.append(response);
}
});
I also add cookies:
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
client.setCookieStore(myCookieStore);
BasicClientCookie newCookie = new BasicClientCookie("id", 17882);
myCookieStore.addCookie(newCookie);
But while making a GET request how can I send my cookies inside the request object ?
Regarding to documentation client has these method signatures:
void get(Context context, String url, AsyncHttpResponseHandler responseHandler)
void get(Context context, String url, Header[] headers, RequestParams params, AsyncHttpResponseHandler responseHandler)
void get(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
void get(String url, AsyncHttpResponseHandler responseHandler)
void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
I would be happy if you can give an example that sends persistent cookies inside the GET request.