AFNetWorking如何在发送数据之前拿到转为json的参数 对他进行加密?
我想加密首选是 https,这样你不需要手动写加密算法就可以给 body 加密。
如果一定要按自己的协议加密的话,可以
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] requestWithMethod: URLString: parameters: error:];
这样先得到 request,然后取到request.HTTPBody
,加密完了之后,
AFHTTPRequestOperation *operation = [manager HTTPRequestOperationWithRequest:request success:nil failure:nil];
再发出去……