给java后台发送携带数组的json数据,java后台接收到的数
2019-04-08 本文已影响0人
CYC666
需要设置一下请求头
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
NSString*url = [NSStringstringWithFormat:@"%@%@",IM_Java_URL, method];
manager.responseSerializer.acceptableContentTypes=[NSSet setWithObjects:@"text/javascript",@"text/plain",@"text/xml",@"",@"text/html",@"text/json",@"image/jpeg",@"application/json",@"application/javascript",@"application/x-www-form-urlencoded", nil];
manager.requestSerializer=[AFJSONRequestSerializer serializer]; // 加上这个