标签: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) { //处理请求结果 }];
标签:ios
原文地址:http://451143112.blog.51cto.com/10235476/1651780