1

クッキーは設定されていません。以下はコードです。

DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpPostRequest = new HttpPost(URL);

CookieStore cookieStore = new BasicCookieStore(); 
BasicClientCookie cookie = new BasicClientCookie("Name", "value");
cookieStore.addCookie(cookie); 

HttpContext localContext = new BasicHttpContext();

localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
httpPostRequest.setEntity(fileentity);

HttpResponse response = (HttpResponse) httpclient.execute(httpPostRequest,localContext);

も試しました

httpclient.setCookieStore(cookieStore); 

しかし、何も機能しません。

4

0 に答える 0