i am a beginner in iphone programming ,i found the following code on a site but dont know the function of the code can anyone please explain the function of the code. according to my view it might be the code for picking a file from a location to upload it onto server. is this so?
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setPostValue:@"Ben" forKey:@"first_name"];
[request setPostValue:@"Copsey" for开发者_如何转开发Key:@"last_name"];
[request setFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photo"];
It looks like it makes use of the ASIHTTPRequest framework. It's part of a setup to make a http post request setting some parameters.
you are right!
this code will execute an HTTP POST with two form data fields and a file to upload.
Have a look at this. It might help you :
ASIFormDataRequest
These values might be used to pass as a parameter to some HTTP POST Request.
精彩评论