How do I write objective-C code to click this HTML submit button in iOS?
<input type="password" class="lp_input" size="13" name="password" autocomplete="off">
<input type="text" class="lp_input" size="13" name="username" value="" autocomplete="off">
<input name="login" id="submitform" type="submit" class="o" value="Logon">
I've already created a request object, but don't know how to use it to submit the above.
NSURL *url = [NSURL URLWithString:@"https://connect.website.com"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
[request setValue:self.userName forHTTPHeaderField:@"username"];
[request setValue:self.Password forHTTPHeaderField:@"password"];
//HOW DO I SUBMIT THIS?
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
if (connection) {
mutData = [NSMutableData data];
}