search

Home  >  Q&A  >  body text

ios - AFNetWorking参数加密

AFNetWorking如何在发送数据之前拿到转为json的参数 对他进行加密?

ringa_leeringa_lee2948 days ago470

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 17:36:03

    I think the first choice for encryption is https, so that you can encrypt the body without manually writing the encryption algorithm.

    If you must encrypt according to your own protocol, you can

    NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] requestWithMethod: URLString: parameters: error:];

    In this way, we first get the request, and then get request.HTTPBody. After the encryption is completed,

    AFHTTPRequestOperation *operation = [manager HTTPRequestOperationWithRequest:request success:nil failure:nil];

    Send it out again...

    reply
    0
  • Cancelreply