Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 461
max_ Avatar asked Oct 25 '22 17:10

max_


1 Answers

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.

like image 178
Cameron Spickert Avatar answered Nov 11 '22 16:11

Cameron Spickert