Xutils used
An error occurred in the title
Reason: no cookie was added
1 params.addHeader("Cookie", CurrentUserSettings.getCookies());
After that, the problem will be solved
Cookies are obtained by
final HttpUtils httpUtils = new HttpUtils();
params.setPriority(Priority.BG_TOP);
httpUtils.send(HttpRequest.HttpMethod.POST, url, params, new RequestCallBack<String>() {
@Override
public void onSuccess(ResponseInfo<String> responseInfo) {
DefaultHttpClient defaultHttpClient = (DefaultHttpClient) httpUtils.getHttpClient();
List<Cookie> cookies = defaultHttpClient.getCookieStore().getCookies();
if (cookies.size() > 0) {
CurrentUserSettings.setCookies(cookies.get(0).getName() + "=" + cookies.get(0).getValue());
}
}
}
Similar Posts:
- [leetcode] 140. Word break II word split II
- Java Thread wait, notify and notifyAll Example
- [Solved] Exception in thread “main” java.util.ConcurrentModificationException
- builtin_function_or_method’ object is not subscriptable [How to Solve]
- WGet download Oracle JDK
- Convert Object to List>, avoiding Unchecked cast: ‘java.lang.Object’ to ‘java.util.List
- [leetcode] 280. Wiggle sort
- [Solved] cookie loss when uploading components using the elementui framework El upload
- [Solved] java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null”
- Common attributes of unity inspector panel