Key-value pair request in ASIFormDataRequest does not get response

Posted by onkar on Stack Overflow See other posts from Stack Overflow or by onkar
Published on 2012-11-24T04:38:31Z Indexed on 2012/11/24 5:04 UTC
Read the original article Hit count: 186

Filed under:
|
|
|

I am sending a key-value pair inorder to get jSON response.I am trying this way.

NSString *url = SAMPLE_URL;
ASIFormDataRequest *request =[[[ASIFormDataRequest alloc] init] autorelease];
     request=[ASIFormDataRequest requestWithURL:url];

   // NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
    //[request setURL:[NSURL URLWithString:url]];
    [request setHTTPMethod:@"POST"];
    [request setPostValue:@"admin" forKey:@"username"];
    [request setPostValue:@"123456" forKey:@"password"];

Issue The code is running fine, but no-response/acknowledgement is obtained.

EDIT 1

 [request setHTTPMethod:@"POST"];

has been changed to

[request setRequestMethod:@"POST"];

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c