ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
2014-04-01 15:27
531 查看
NSString *postURL = [NSString stringWithFormat:@"http://xxxxxx.php?mod=%@&data=%@", mod, data];
NSLog(@"发送注册请求URL:%@", postURL);
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:postURL]];
[request startSynchronous];
如果是 Get ,或者参数可以简单的组成 Get 方式提交的时候, 比如 thread.php?id=123 , 就用 ASIHTTPRequest 就可以了
如果必须是 POST ,或者参数很多,你要构造一个带参数的 URL 很麻烦的时候,就用 ASIHttpFormDataRequest
NSLog(@"发送注册请求URL:%@", postURL);
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:postURL]];
[request startSynchronous];
如果是 Get ,或者参数可以简单的组成 Get 方式提交的时候, 比如 thread.php?id=123 , 就用 ASIHTTPRequest 就可以了
2. NSString *postURL = [NSString stringWithFormat:@"http://xxxxxx.php"]; ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:postURL]]; [request addPostValue:myModel forKey:@"mod"]; [request addPostValue:myAllData forKey:@"data"]; [request startSynchronous];
如果必须是 POST ,或者参数很多,你要构造一个带参数的 URL 很麻烦的时候,就用 ASIHttpFormDataRequest
相关文章推荐
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,分别什么时候用
- IOS 学习笔记 —— ASIHTTPRequest 之 ASIFormDataRequest
- ASIHTTPRequest / ASIFormDataRequest - referencing request object within blocks under ARC
- 什么时候使用ASIHTTPRequest或ASIFormDataRequest,怎么判断啊???
- 什么时候该用ASIHTTPRequest,什么时候该用ASIFormDataRequest
- ASIHTTPRequest Get和Post的区别
- object-c的http post请求之 ASIFormDataRequest使用
- Get、Post(HTTP中最常用的请求方式 使用ASIHTTPRequest)----例如:登录、上传图片(调用手机相册 UIImage 转为data)
- ASIHTTPRequest的使用——ASIFormDataRequest(自定义封装类)
- ASIHTTPRequest实现对PUT,DELETE,POST,GET请求方式的处理
- Get Post Data From Http Request
- HTTP Request的Get、Post的区别
- ASIHTTPRequest 对GET和POST请求简单封装
- HTTP Request的Get、Post的区别
- ASIFormDataRequest [request startSynchronous] 方法 crash问题的解决方式
- ASIHTTPRequest 对GET POST 请求简包