当前位置:网站首页>Afnetworking data raw request mode
Afnetworking data raw request mode
2022-07-24 13:52:00 【Muzi string music】
Traditional request mode The code is as follows
// Set timeout
[session.requestSerializer willChangeValueForKey:@"timeoutInterval"];
session.requestSerializer.timeoutInterval = 10.f;
[session.requestSerializer didChangeValueForKey:@"timeoutInterval"];
[session POST:url parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
}]
But this method of calling is based on form-data The way to call , Not on body The way inside
JSON(data-raw) Request mode The code is as follows
// Request header
[session.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
session.requestSerializer = [AFJSONRequestSerializer serializer];
[session.requestSerializer willChangeValueForKey:@"timeoutInterval"];
session.requestSerializer.timeoutInterval = 10.f;
[session.requestSerializer didChangeValueForKey:@"timeoutInterval"];
[session POST:url parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
}];
边栏推荐
- Data modification and insertion
- JS execution mechanism
- 网络安全——文件上传黑名单绕过
- 三层交换机配置MSTP协议详解【华为eNSP实验】
- Flink容错机制(五)
- Network security - file upload whitelist bypass
- Simple order management system small exercise
- 申请了SSL数字证书如何进行域名验证?
- Ansible服务常用命令模块详细解析
- The R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graphs, uses the by parameter to specify the groupi
猜你喜欢

Group knowledge map: distributed knowledge transfer and federated map reasoning

CSDN垃圾的没有底线!

网络安全——文件上传黑名单绕过

Game thinking 04 summary: a summary of frame, state and physical synchronization (it was too long before, and now it's brief)

使用树莓派做Apache2 HA实验

Network security - Web information collection

Network security - file upload whitelist bypass

2022.7.22 模拟赛

Csp2021 T3 palindrome

Sringboot plugin framework implements pluggable plug-in services
随机推荐
微信小程序 TODO案例
How to generate expected data? Emory University and others' latest "deep learning controllable data generation" review, 52 page PDF, covering 346 documents, comprehensively expounds the controllable g
Flink comprehensive case (IX)
Simple order management system small exercise
R语言使用epiDisplay包的statStack函数基于因子变量通过分层的方式查看连续变量的统计量(均值、中位数等)以及对应的假设检验、对连续数据进行对数化之后符合参数检验条件自动执行参数检验
数据修改插入
Network security - error injection
Noip2021 T2 series
Nmap安全测试工具使用教程
FlinkTable&SQL(六)
2022.7.22 模拟赛
自动化运维之Ansible安装部署
R language uses the statstack function of epidisplay package to view the statistics (mean, median, etc.) of continuous variables and the corresponding hypothesis test in a hierarchical manner based on
WSDM 22 | graph recommendation based on hyperbolic geometry
Network security - penetration using evil maid physical access security vulnerabilities
Unity行人随机行走不碰撞
SQL Server 启停作业脚本
Network security - war backdoor deployment
使用Activiti创建数据库表报错,
Wechat applet todo case