Already i used the POST with Restkit is working fine. But i don't know what is difference between POST and PUT in Restkit. I just changed the method type only to "PUT". But my parameter is not sending to Webservice.
Below is my code, the same code for POST is working to me.
AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:URL];
[client setDefaultHeader:@"Authorization" value:[DSUserDefaults user].accessToken];
NSDictionary *prefDict=[NSDictionary dictionaryWithObjectsAndKeys: @"",@"COMPANY_ID" ,@"",@"JOBTITLE",@"2",@"JOBTYPE" ,@"San Franscisco, US",@"LOCATION", nil];
NSLog(@"prefDict %@",prefDict);
NSMutableURLRequest *request = [client requestWithMethod:PUT path:@"" parameters:prefDict];
[request setURL:URL];
[request setTimeoutInterval:60.0];
[request setHTTPMethod:PUT];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[AFHTTPRequestOperation addAcceptableStatusCodes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(100, 500)]];
[operation setCompletionBlockWithSuccess: ^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"operation.responseString: %@", operation.responseString);
NSData *data =[operation.responseString dataUsingEncoding:NSUTF8StringEncoding];
}
How to send "text" data to request. I don't need to send as dictionary.