I request to log in using HttpWebRequest simulation, return to the login is successful, then go to the requested page data, always return a 301 error, prompt the user has expired, with caught tools also saw, cookies, token is correct, I don't know where is wrong? Is not sure cookie is out of date, or cross domain redirection,
I use the
Request. CookieContainer=CookieContainer; Save the login cookie;
And use the
String strLocation.=the response Headers (" Location ");
Returns the request data redirection address, found the strLocation is empty,
Please help to instruct me, have a week, haven't done,
CodePudding user response:
301 can't say it's wrong, it is redirected (version Permanently, is changed to another address on web pages), you only have to visit the new address is ok,Let the HttpWebRequest automatic transfer, can set the HttpWebRequest. AllowAutoRedirect,
CodePudding user response: