the initial failure was due to the fact that the login sent the post instruction without any code for access, after studying the OC code of the seniors,found that he acquired the server cookie at Init and extracted it from the cookie Csrftoken, and added it to the access header at login, asthe token for the permission. After I tried, I finally got the cookie and added Csrftoken to HttpURLConnection's head, and returned403, we have been here for a long time lag. after the help of the learning elder sister, finally understand that Csrftoken is not the only authority identifier, but the need to add all the cookies obtained by the init login Access to the server's httpclient header to complete the access. The difference between the two popular point is equivalent to two people to access a server, two people with aand b indicate that a is responsible for INIT,B login. The first method is like a first initialization of a cookie that has access rights, and then the token given to B,then B takes the token obtained from a to access it, so the server is recognized as insufficient authority. The second method is equivalent to the first initialization of a given access rightsCookie, and then give all of the resulting cookie including token to B, at which point B is equivalent to a copy, which is equivalent to a once again to access the servicewhen the service considers that B has access rights. (PS: Originally thought HttpURLConnection and httpclient send the data format is different, therefore beganis to send the post instructions with HttpURLConnection, and later found that the implementation of the effect is equivalent, so after swapping with httpclient to implement the POST request).
Reasons for the previous failure of network connectivity issues