Set httpclient not to automatically manage cookies

 

 

HttpClient supports automatic management of cookies, and supports automatic saving and sending of cookies.

However, sometimes we don't want this, we want each request to be independent of each other,

Then, you can do the following settings.

client.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.IGNORE_COOKIES);

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326058214&siteId=291194637