//创建网络请求管理对象
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager.requestSerializer setValue:@"value" forHTTPHeaderField:@"key"];
[manager POST:url parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"\n请求URL:%@\n请求方式:%@\n请求头信息:%@\n请求正文信息:%@\n请求响应时间:",task.originalRequest.URL,task.originalRequest.HTTPMethod,task.originalRequest.allHTTPHeaderFields,[[NSString alloc] initWithData:task.originalRequest.HTTPBody encoding:NSUTF8StringEncoding]);
success(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failure(error);
}]; }
请求URL:https:/cs.johome.com/s2b2capi/Member/GetVerificationCode 请求方式:POST 请求头信息:{ "Accept-Language" = "zh-Hans;q=1"; key = "value"; "Content-Type" = "application/json"; "User-Agent" = "banbick/1 (iPhone; iOS 13.5; Scale/2.00)"; } 请求正文信息:{"type":2,"mobile":"19","regionalCode":"86"} 请求响应时间: