AFNetworking - How can I PUT and POST raw data without using a key value pair?

后端 未结 6 999
执念已碎
执念已碎 2020-12-15 22:20

I am trying to make an HTTP PUT request using AFNetworking to create an attachment in a CouchDB server. The server expects a base64 encoded string in the HTTP b

6条回答
  •  自闭症患者
    2020-12-15 23:03

    You can use multipartFormRequestWithMethod method as following:

    NSURLRequest *request = [self multipartFormRequestWithMethod:@"PUT" path:path parameters:parameters constructingBodyWithBlock:^(id  formData) {
        [formData appendString:]
    }];
    AFHTTPRequestOperation *operation = [client HTTPRequestOperationWithRequest:request success:success failure:failure];
    [client enqueueHTTPRequestOperation:operation];
    

提交回复
热议问题