Content-Type:application/x-www-form-urlencoded; charset=UTF-8 设置方法 针对AFN或者是原生
来源:互联网 发布:网络用语2017最新数字 编辑:程序博客网 时间:2024/06/07 00:13
NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/x-www-form-urlencoded; charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
[urlRequest setHTTPBody:[[NSString stringWithFormat:@"endTime=%@", endTime]dataUsingEncoding:NSUTF8StringEncoding]];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if(data)
success(data);
}];
[dataTask resume];
重要的事情说三遍
记得放到多线程里 记得回主线程更新视图!!
记得放到多线程里 记得回主线程更新视图!!
记得放到多线程里 记得回主线程更新视图!!
- Content-Type:application/x-www-form-urlencoded; charset=UTF-8 设置方法 针对AFN或者是原生
- Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- (转)获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- Content-Type: application/x-www-form-urlencoded
- [转]Content-Type: application/x-www-form-urlencoded
- Content-Type: application/x-www-form-urlencoded什么意思
- 关于 Content-Type:application/x-www-form-urlencoded
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/rel
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/rel (2
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- Swift3.0 / swift2.3中dispatch_group的使用
- MySQL必知必会-16MySQL布尔文本搜索
- noi-8173-密码翻译
- M-13
- BZOJ 4292: [PA2015]Równanie
- Content-Type:application/x-www-form-urlencoded; charset=UTF-8 设置方法 针对AFN或者是原生
- 课堂总结,延伸
- 终于开通博客了
- JavaScript特性(attribute)、属性(property)和样式(style)
- 紫书动规 例题9-6 UVA
- JAVA生产者与消费者
- 2017全国深度学习技术应用大会
- android 手机通过 usb 共享电脑网络
- PostgreSQL导入备份文件