I am using AFNetworking
to sent a post request to a sever,
the request is successful, but no data were sent to the server.
the response string is the html form itself and
the form is filled in the value i sent to the sever.
Here is the code
NSURL *url = [NSURL URLWithString:@"http://www.example.com"];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"", @"__EVENTTARGET",
@"", @"__EVENTARGUMENT",
@"", @"__LASTFOCUS",
self.VIEWSTATE, @"__VIEWSTATE",
self.subject.text, @"ctl00$ContentPlaceHolder1$messagesubject",
self.message.text, @"ctl00$ContentPlaceHolder1$messagetext",
@"yes", @"ctl00$ContentPlaceHolder1$btn_Submit",
nil];
[httpClient postPath:@"/post.aspx" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *responseStr = [[NSString alloc] initWithData:operation.responseData encoding:NSUTF8StringEncoding];
NSLog(@"Request Successful, response '%@'", responseStr);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"[HTTPClient Error]: %@", error.localizedDescription);
}];
any idea?