AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
// 发送post请求
// manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
//
manager.requestSerializer=[AFHTTPRequestSerializer serializer];
NSDictionary *json = [NSDictionary dictionary];
NSString *str = [NSString stringWithFormat:@"{\"city\":\"%@\",\"country\":\"%@\",\"headimgurl\":\"%@\",\"language\":\"%@\",\"openid\":\"%@\",\"province\":\"%@\",\"sex\":%@,\"unionid\":\"%@\",\"userName\":\"%@\"}",self.userInfoDict[@"city"],self.userInfoDict[@"country"],self.userInfoDict[@"headimgurl"],self.userInfoDict[@"language"],self.userInfoDict[@"openid"],self.userInfoDict[@"province"],self.userInfoDict[@"sex"],self.userInfoDict[@"unionid"],self.userInfoDict[@"nickname"]];
json = @{
// @"city":self.userInfoDict[@"city"],
// @"country":self.userInfoDict[@"country"],
// @"headimgurl":self.userInfoDict[@"headimgurl"],
// @"language":self.userInfoDict[@"language"],
// @"openid":self.userInfoDict[@"openid"],
// @"province":self.userInfoDict[@"province"],
// @"sex":self.userInfoDict[@"sex"],
// @"unionid":self.userInfoDict[@"unionid"],
// @"userName":self.userInfoDict[@"nickname"],
@"json":str,
// @"json":@"json"
};
NSLog(@"post调试%@",json);
NSString *URLStr = @"http://10.62.16.247:8080/LoginServlet.bmh";
[manager POST:URLStr parameters:json progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSString *str = responseObject;
NSLog(@"post回调====%@",str);
NSLog(@"post成功");
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"post失败");
}];
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有