I want to send String Data to a php server using the ASIHTTPRequest appendPostData method but its not working.
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request appendPostData:[@"123456" dataUsingEncoding:NSUTF8StringEncoding]];
[request startAsynchronous];
I tried some modifications on the request itself like:
[request setRequestMethod:@"POST"];
[request buildPostBody];
but also this does not work.
When i use the
[request addPostValue:@"Ben" forKey:@"names"];
syntax it does work.
Anybody has an idea whats wrong here?!
I usually use this:
Parameters:
(NSString *)string– url string, where to post your request;(NSDictionary *)stringDictionary– dictionary, which contains all the text information (such as name, id etc.);(NSDictionary *)dataDictionary– dictionary, which contains all data information (such as photos, files, etc.);(id)requestDelegate– delegate to perform selectors below;(SEL)requestSelector– selector, which will be executed while successfully request;(SEL)errorSelector– selector, which will be executed, while error occurred.P.S. Selectors will be used in the
ASIHTTPRequest Delegateimplementation