You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
blakewatters edited this page Nov 16, 2011
·
1 revision
RestKit uses MIME Types to determine how to handle object mapping and serialization operations. If your remote web server is using a MIME Type other than application/xml, application/json, or application/x-www-form-urlencoded you will have to configure RestKit appropriately. There are two parts to the configuration:
Configuring a parser to handle the MIME Type. This is done via the RKParserRegistry shared instance. In the example below, we'll alias an existing JSON parser to handle a new MIME Type:
Configure the object manager to accept and generate content using your custom MIME Type. This is done via simple property accessors on RKObjectManager:
The object manager is now configured to accept the custom MIME Type "application/vnd.company.customobject-v1+json" and parse it using the JSONKit parser. When an object is serialized for transport to the remote system via postObject: or putObject:, it will be encoded to JSON and sent with the MIME Type of "application/vnd.company.customobject-v1+json" as well.