私はこのようなGETリクエストを行います。LoopJ AndroidAsyncHttpと要求クッキー
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);
}
});
私もクッキーを追加します。
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
client.setCookieStore(myCookieStore);
BasicClientCookie newCookie = new BasicClientCookie("id", 17882);
myCookieStore.addCookie(newCookie);
しかし、私は送ることができますどのようにGETリクエストをしながらリクエストオブジェクトの中の私のクッキー? documentationクライアントにについて
は、これらのメソッドのシグネチャを持っています
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)
あなたがGETリクエスト内の永続的なCookieを送信例を与えることができれば、私は幸せになります。
はすでにクッキーを追加しています。 client.get()の前に追加してください。 – robotoaster