I am Trying to Update data through NSUrlConnection using PUT method. For adding data i am using POST method it's working fine but the same time PUT it's not working.
NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"%@update/%@?userId=%@",xapp.urlString,[dict valueForKey:@"id"],[profileDict valueForKey:@"id"]] ];
NSError *error;
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error];
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"PUT"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:jsonData];
updateHiveConnection=[NSURLConnection connectionWithRequest:request delegate:self];
I am sending JSON Data to this api {"id":3,"active":false} after that i am getting error
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x1fb456f0 {NSDebugDescription=No value.}
Any help would be appreciated thanks