简体   繁体   中英

AFNetworking upload task with POST parameters

I'm wondering how to use AFNetworking to make a POST request with a file, a few parameters and progress report of the upload.

AFURLSessionManager's uploadTaskWithRequest:fromFile:progress:completionHandler works for POST upload with progress, but I cannot figure out how to add the POST parameters.

I've also looked into AFHTTPSessionManager's POST:parameters:constructingBodyWithBlock:success:failure: , but that doesn't appear to be able to report upload progress.

How do I get the best of both worlds?

查看结合使用uploadTaskWithStreamedRequest:progress:completionHandler:multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM