title: Transform curl to js(ajax)
body: <p>I want to create an API to send a photo or video to <a href="https://partner.path.com/1/moment/photo(recorded" rel="nofollow">https://partner.path.com/1/moment/photo(recorded</a> as A)</p>
  
  <p>It can be done successfully by curl as the following:</p>
  
  <pre><code>curl -H 'Authorization: Bearer &lt;ACCESS_TOKEN&gt;' 
  -F "image=@F:photo.jpg" 
  -F 'data={"caption": "I like cheese!"}' 
  A
  </code></pre>
  
  <p>However,it is failed(400 BAD_REQUEST) when sending the request by Ajax as the following: </p>
  
  <pre><code>$.ajax({
  type : "POST",  
  url : "A",
  async : false,
  data : "{"image":"@F:photo.jpg", "caption":"I like the picture", "private":true}",
  dataType : 'json',
  contentType : "application/json",
  crossDomain : true,
  beforeSend : function(xhr) {
  xhr.setRequestHeader("Authorization", "Bearer 5f323a1c21a89cde270ffe78b3835d8a4bdd67c0");
  },
  success : function(res, textStatus) {
  console.log(res);               
  }
  });
  </code></pre>
  
  <p>I think the problem maybe exist on the parameters(particularly the data parameter) when making ajax call.
  What is the correct format of the data parameter? </p>