title: Custom MIME Types with RestKit
body: <p>I've been banging my head against a wall around which methods in RestKit to pick to fulfill what I'm trying to achieve. </p>
  
  <p>I have been given an API specification that requires me to POST and object in JSON format with a custom MIME type and then receive the updated JSON representation of that object and deserialize it.</p>
  
  <p>I have tried simply using [[RKObjectManager sharedManager] postObject:customobject delegate:handler] however I can't get this to use anything except form encoding.</p>
  
  <p>I then tried <code>[[RKObjectManager sharedManager] objectLoaderForObject:customObject method:RKRequestMethodPost delegate:handler]</code> and setting the serialization MIME type to <code>@"application/json"</code>. This works for serializing the object as JSON but doesn't help with the custom Content-Type.</p>
  
  <p>Using the second method above, I tried implementing the <code>HTTPHeaderValueForContentType</code> message but this never seems to be called and the params object is an NSDictionary.</p>
  
  <p>From there I've tried adding the custom MIME type the Parser Registry using the same logic as <code>[RKParseRegistry autoconfigure]</code> but I feel that I'm digging deeper into hack territory with every step.</p>
  
  <p>The problem with this approach too is that it doesn't help my "Accepts" header, it is still "<code>application/json</code>".</p>
  
  <p>Below is some specification about the REST API I need to consume (with some keywords changed)</p>
  
  <p>NB: <a href="http://groups.google.com/group/restkit/browse_thread/thread/261f59ad17797ba3" rel="nofollow">I have cross-posted this on the RestKit Google Group</a></p>
  
  <hr>
  
  <pre><code>Request POST /customobject/ HTTP/1.1
  Accepts application/vnd.company.customobject-v1+json
  application/vnd.company.customobject-v1+xml
  Content-Type    application/vnd.company.customobject-v1+json
  Sample content  {
    "type"      : "type-a",
    "direction" : "left",
    "listofitems": [
      { "itemnumber": "123"}
      ]
  }
  
  
  Response    HTTP/1.1 201 Created
  Content-Type    application/json
  Location    /customobject/[id]
  </code></pre>