开发者

ASIFormDataRequest POST returning website source code?

I am using the following code to set the username and password to a form on a website:

ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url];
        [request setRequestMethod:@"POST"];
        [request setPostValue:[[NSUserDefaults standardUserDefaults] objectForKey:kUsername] forKey:@"username"];
        [request setPostValue开发者_如何学编程:[[NSUserDefaults standardUserDefaults] objectForKey:kPassword] forKey:@"password"];
        [request setTimeOutSeconds:40];
        [request setDelegate:self];
        [request startAsynchronous];

However I am NSLogging the responseString from this request, and it is just printing out the source code of the website rather than any information.


This is likely a server-side issue or a logic error. In addition to responseString, look at responseHeaders and responseStatusCode to make sure you're getting what you expect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜