iOS网络post请求

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
   //  post请求(代理方式) 
 
//    NSURL * url = [NSURL URLWithString:@"http://192.168.2.162/logo.php"];
 
//   
 
//    //通过URL建立请求对象
 
//    NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL:url];
 
//   
 
//    //设置请求方式(默认的是get方式)
 
//    request.HTTPMethod = @"POST";//使用大写规范
 
//   
 
//    //设置请求参数
 
////    NSString * str = @"userName=jereh&pwd=123";
 
//    NSString * str = @"test2.rar";
 
//    request.HTTPBody = [str dataUsingEncoding:NSUTF8StringEncoding];
 
//   
 
//    //创建NSURLConnection 对象用来连接服务器并且发送请求
 
//    NSURLConnection * conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
 
//    [conn start];
 
//    NSLog(@"%@", [NSThread currentThread]);