I want to send put request using restkit putobject and receive the response as 200 and string from the server, but server is giving me 400 and saying not receiving body. Request is request: https://myserver.com/api/v1/f1//update body = "somevalue" Response is 200 "somevalue"
for this i am having restkit implment request https://myserver.com/api/v1 path f1//update
here is the code
RKObjectMapping *responseMapping = [RKObjectMapping mappingForClass:[ModelUpdate class]];
[responseMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:nil toKeyPath:@"status"]];
RKResponseDescriptor *responseDescriptor =
[RKResponseDescriptor responseDescriptorWithMapping:responseMapping
method:RKRequestMethodPUT
pathPattern:path
keyPath:nil
statusCodes:[NSIndexSet indexSetWithIndex:200]];
*objectPath=path;
RKRequestDescriptor *requestDescriptor = [RKRequestDescriptor requestDescriptorWithMapping:[responseMapping inverseMapping] objectClass:[ModelUpdate class] rootKeyPath:nil method:RKRequestMethodAny];
[rkObjectManager addResponseDescriptor:responseDescriptor];
[rkObjectManager addRequestDescriptor:requestDescriptor];
rkObjectManager.requestSerializationMIMEType = RKMIMETypeJSON;
[rkObjectManager putObject:someObj path:path parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
id updateField = mappingResult.array;
[sDFWebInterface->m_DFWebInterfaceData receiveResponse:updateField forRequestNo:requestNo error:nil];
NSLog(@"Success");
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"Error from server in Put Request");
[sDFWebInterface HandleServerAPIError:requestNo :error];
}];
/////Modelupdate class
@interface ModelUpdate : NSObject
@property(nonatomic,strong)NSString* status;// :
@end