title: REST POST MIME on client (actionscript) when trying to POST to Sharepoint 2013
body: <p>I'm trying to do a POST to insert values in a Sharepoint 2013 list from an AIR client.
  The GET works and authentication is ok.</p>
  
  <p>Here is my as3 code:</p>
  
  <pre><code>URLRequestDefaults.authenticate = true;
  URLRequestDefaults.setLoginCredentialsForHost("srv", "usr", "pwd");
  
  var postURL:URLRequest= new URLRequest("http://srv/site/_api/web/lists/getByTitle('list')/items");      
  postURL.authenticate = true;
  postURL.method = URLRequestMethod.POST;
  postURL.requestHeaders.push( new URLRequestHeader("ACCEPT","application/json;odata=verbose"));
  postURL.requestHeaders.push( new URLRequestHeader("ContentType","application/json"));
  postURL.data = JSON.stringify({ '_metadata': { 'type': 'SP.listnameListItem' }, 'Title': 'desc' });
  postLoader = new URLLoader(postURL);
  postLoader.dataFormat = URLLoaderDataFormat.TEXT;
  postLoader.addEventListener(flash.events.Event.COMPLETE, postDone);
  postLoader.addEventListener(IOErrorEvent.IO_ERROR, handleIOError );
  postLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );
  postLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleSecurityError );
  postLoader.load(postURL);
  </code></pre>
  
  <p>When I run it, it goes to the handleIOError method:</p>
  
  <pre><code>private function handleIOError ( event:IOErrorEvent ):void
  {
   trace ( "Load failed: IO error: " + event.text );
   trace ( "data IO error: " + event.currentTarget.data.toString() );
  }
  </code></pre>
  
  <p>I got this error: Microsoft.Data.OData.ODataContentTypeException A supported MIME type could not be found that matches the content type 
      of the response. None of the supported type(s) 'application/atom+xml;type=feed,
      application/atom+xml, application/json;odata=verbose' matches the content type
     'text/xml;charset=utf-8'
  Any idea?
  Thanks</p>