Objective-C Post request send no data -


i'm trying send post request url

but server empty data

nsstring *post = [nsstring stringwithformat:@"cmd=login&account=%@&password=%@" ,account ,password]; nsdata *data = [post datausingencoding:nsasciistringencoding]; nsmutabledata *postdata = [data mutablecopy];  nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init];  [request seturl:[nsurl urlwithstring:[nsstring stringwithformat:@"http://myurl.com"]]];  [request sethttpmethod:@"post"];  [request sethttpbody:postdata];  nserror *error = nil; nshttpurlresponse* urlresponse = nil; nsdata *returndata = [nsurlconnection sendsynchronousrequest:request returningresponse:&urlresponse error:&error]; nsstring *returnstring = [[nsstring alloc] initwithdata:returndata encoding:nsasciistringencoding]; nslog(@"%@", returnstring); nslog(@"error: %@", error.localizedfailurereason); 

here response

2014-08-18 17:21:52.332 signpos[2755:303] {"resp":99,"desc":"invalid cmd"}

2014-08-18 17:21:52.333 signpos[2755:303] error: (null)

is there wrong?

thanks!


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -