Question

I want to fill two textfields in a page I loaded in UIWebView. I have been busy with NSMutableRequests. My code:

// webView is an object of UIWebView

// This is my ViewDidLoad Function

NSString *cijferString = @"leerling.degoudsewaarden.nl";
NSURL *cijferURL = [NSURL URLWithString:cijferString];
NSMutableURLRequest *request = [NSMutableURLReuqest requestWithURL:cijferURL];

NSString *body = [NSString stringWithFormat:@"wu_loginname=%@&wu_password=%@", @"username", @"password"];

[request setHTTPMethod:@"POST"];
[request setHTTPBody: [body dataUsingEncoding:NSUTF8StringEncoding];

[webView loadRequest:request];

All I want is submit my username and password to the webpage. It will automatically load the next page.

Any help is appreciated!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top