title: Office 365 REST API to create contacts using CURL gets HTTPCode 400 Bad Request
body: <p>I am testing Office 365 REST API using CURL following this link:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/office/dn792115(v=office.15).aspx" rel="nofollow">Contacts REST API in Office 365 APIs Preview</a></p>
  
  <p>I can obtain correctly one contact using curl command in Windows like this:</p>
  
  <pre><code>curl --no-sessionid --insecure --basic --user "user@domain.com:password" -H "Accept: application/json" "https://outlook.office365.com/EWS/OData/Me/Contacts?$orderby=DisplayName+asc&amp;$top=1"
  </code></pre>
  
  <p>And following documentation on this link if I try to create one contact using CURL with minimum required options for testing:</p>
  
  <pre><code>curl -X POST -d "{\"@odata.type\": \"#Microsoft.Exchange.Services.OData.Model.Contact\",\"GivenName\": \"TestContact\",\"EmailAddress1\": \"test@test.com\",\"BusinessPhone1\": \"123-456-7890\"}" https://outlook.office365.com/ews/odata/Me/Contacts --header "Content-Type:application/json" --insecure --verbose --user "user@domain.com:password"
  </code></pre>
  
  <p>I receive following error:</p>
  
  <pre><code>* About to connect() to outlook.office365.com port 443 (#0)
  *   Trying 157.56.250.178...
  * connected
  * Connected to outlook.office365.com (157.56.250.178) port 443 (#0)
  * SSLv3, TLS handshake, Client hello (1):
  ...
  * SSL connection using ECDHE-RSA-AES256-SHA
  * Server certificate:
  ...
  * Server auth using Basic with user 'user@domain.com'
  &gt; POST /ews/odata/Me/Contacts HTTP/1.1
  ...
  &gt; Content-Length: 157
  &gt;
  * upload completely sent off: 157 out of 157 bytes
  &lt; HTTP/1.1 400 Bad Request
  ...
  &lt; Content-Length: 82
  &lt;
  {"error":{"code":"ErrorInvalidRequest","message":"Cannot read the request body."}}* Connection #0 to host outlook.office365.com left intact
  * Closing connection #0
  * SSLv3, TLS alert, Client hello (1):
  </code></pre>
  
  <p>I have searched the internet and in stackoverflow but similar questions have no answer I'm looking for.</p>
  
  <p>How could I create on contact using CURL?, I have tested it on Linux too but have the same results.</p>