ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
2013-01-17 08:11
639 查看
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 就可以了
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 iphone下post和get数据的经典类库 配置
- ASIHTTPRequest 对GET POST 请求简单封装
- ASIFormDataRequest的POST操作架构设计。
- HTTP Request的Get、Post的区别
- ASIHTTPRequest实现对PUT,DELETE,POST,GET请求方式的处理
- ASIHTTPRequest 对GET和POST请求简单封装
- ASIHTTPRequest 对GET POST 请求简包