NSMutableURLRequest *request =
[manager.requestSerializer requestWithMethod:@"POST"
URLString:[[NSURL URLWithString:<url string>]
absoluteString] parameters:parameters];
[request setHTTPBody:[self.POSTHttpBody
dataUsingEncoding:NSUTF8StringEncoding]];
__block NSURLSessionDataTask *task = [manager
dataTaskWithRequest:request
completionHandler:^(NSURLResponse * __unused
response, id responseObject, NSError *error) {
if (error) {
// error handling
} else {
// success
}
}];
[task resume];
//本文轉(zhuǎn)載于:https://stackoverflow.com/questions/19712612/how-to-set-http-request-body-using-afnetworks-afhttprequestoperationmanager