Afnetworking 2.0 PUT image

  • I can use put afnetworking 2.0 method to put data.

    NSString * PUTURL = [NSString stringWithFormat: @ "% @ / updateestado / Estado /% @ / idJugador /% l.d.", BaseUrl, [urlEncodeUsingEncoding status: NSUTF8StringEncoding], user ID];

    NSLog (@ "REG URL ----% @", PUTURL);

    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager]; [PUT manager: PUTURL parameters: nil success: ^ (AFHTTPRequestOperation operation *, id responseObject) {NSLog (@ "JSON:% @", responseObject); [self.NET_Delegate DelegateUpdateStatusResponce: responseObject];

    }: ^ (AFHTTPRequestOperation *, NSError * error) {[self.NET_Delegate DelegateUpdateStatusError: error]; }];

    1. I can upload video successfully using post method.
    2. But the requirement for uploading the image is using PUT enter image description here
    3. I followed the method outlined in Simple "PUT" file upload using AFNetworking but there were two issues: multipartFormRequestWithMethod disabled & when trying to access 404 error.
    4. There are no links for this on the afnetworking doc on github.

    5. Request: I am working on loading an image using the first time, so I think I am missing something. Any examples of links or code for this would be helpful. Thanks to

+3


source to share


1 answer


You are not uploading an image; but rather the url of the image (note the parameter url

).

Therefore, you will need to upload the image to a third party site and then submit a link to any service.



There is no way to upload an image using a PUT request so you might be missing something.

+3


source







All Articles