Reputation: 2212
I am able to use put method of afnetworking 2.0 successfully for putting data.
NSString* PUTURL = [NSString stringWithFormat:@"%@/updateestado/estado/%@/idJugador/%ld",BASEURl,[status urlEncodeUsingEncoding:NSUTF8StringEncoding],userId];
NSLog(@"REG URL----%@",PUTURL);
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; [manager PUT:PUTURL parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"JSON: %@", responseObject); [self.NET_Delegate DelegateUpdateStatusResponce:responseObject];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { [self.NET_Delegate DelegateUpdateStatusError:error]; }];
No reference for this on afnetworking doc in github.
Query: I am working on uploading image using put first time, so i think i am missing some thing. Any reference or code samples to achieve this will be helpful. Thanks
Upvotes: 3
Views: 381
Reputation: 122391
You are not uploading an image; but rather a URL of the image (note the url
parameter).
Therefore you will need to upload the image to a 3rd party site and then post the link to whatever that service is.
It's impossible to upload an image using a PUT request so you must be missing something.
Upvotes: 3