ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
2013-02-25 16:02
483 查看
[html] view
plaincopy
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 就可以了
[cpp] view
plaincopy
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
转载:http://blog.csdn.net/lgm252008/article/details/8511546
plaincopy
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 就可以了
[cpp] view
plaincopy
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
转载:http://blog.csdn.net/lgm252008/article/details/8511546
相关文章推荐
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,GET和POST
- ASIHTTPRequest和ASIFormDataRequest 区别,分别什么时候用
- 什么时候该用ASIHTTPRequest,什么时候该用ASIFormDataRequest
- IOS 学习笔记 —— ASIHTTPRequest 之 ASIFormDataRequest
- ASIHTTPRequest / ASIFormDataRequest - referencing request object within blocks under ARC
- 什么时候使用ASIHTTPRequest或ASIFormDataRequest,怎么判断啊???
- Get、Post(HTTP中最常用的请求方式 使用ASIHTTPRequest)----例如:登录、上传图片(调用手机相册 UIImage 转为data)
- ASIHTTPRequest的使用——ASIFormDataRequest(自定义封装类)
- ASIHTTPRequest Get和Post的区别
- object-c的http post请求之 ASIFormDataRequest使用
- ASIFormDataRequest实现post的代码示例
- ASIHTTPRequest发送Get、Post请求,断点下载,上传,判断网络状态
- 20110215 学习记录2:表单中的get和post区别 & 使用 HttpWebRequest 向网站提交数据
- 黑马程序员---XMLHttpRequest 对象open参数中使用post与get区别
- ajax中XMLHttpRequest对象的open()方法GET和POST方式区别
- HttpRequest的POST和GET的区别[摘自百度知道]
- HttpRequest的POST和GET的区别