I was looking for a way to map an empty object to be posted to an endpoint. The call needs to be a POST
, but there shouldn't be any data posted to the endpoint (empty body), it's only about calling the endpoint directly without data.
I've tried doing the same trick as in RestKit: How to handle empty response.body? but using RKRequestDescriptor
instead.
Doing so leads to following error when using postData:nil
in RKObjectMapping
's postObject
method:
Uncaught exception:
RKRequestDescriptor
objects must be initialized with a mapping whose target class isNSMutableDictionary
, got 'NSNull' (see[RKObjectMapping requestMapping]
);
Using NSNull
for the RKRequestDescriptor
's mapping seems to work, but nil
seems to fail the mapping action.