码迷,mamicode.com
首页 > 其他好文 > 详细

ASDFASDFA

时间:2015-05-16 01:34:33      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:ios

//设置HTTP Content-Length
    NSString *lenStr = [NSString stringWithFormat:@"%ld",request.HTTPBody.length];
    [request setValue:lenStr forHTTPHeaderField:@"Content-Length"];
    
    //设置HTTP Content-Type
    [request setValue:formData.contentType forHTTPHeaderField:@"Content-Type"];
    
    // 5.发送请求
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
       //处理请求结果
    }];


ASDFASDFA

标签:ios

原文地址:http://451143112.blog.51cto.com/10235476/1651780

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!