此示例代码应该可以帮助您
-(void)sendRequest
{
int userId=10, time=10000;
NSString *name = @"ABC";
float info = 1.0;
NSString *urlString = [NSString stringWithFormat:@"http://test.com/mobile_api/register?id=%d&name=%@&info=%f&time=%d",userId,name,info,time];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:urlString]];
//You need to add ASIHTTPRequestDelegate in header(.h) file
[request setDelegate:self];
[request startAsynchronous];
}
- (void)requestFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
// Use when fetching binary data
NSData *responseData = [request responseData];
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSError *error = [request error];
}