title: Response for CORS preflight is 405 (Method Not Allowed) error
body: <p>I am trying to upload foursquare user's profile photo from my angular web application. I am using "users/update" end point -
   <a href="https://developer.foursquare.com/docs/users/update" rel="nofollow noreferrer">https://developer.foursquare.com/docs/users/update</a></p>
  
  <p>Here is my template,  </p>
  
  <pre><code>&lt;input type="file" (change)="fileChange($event)" placeholder="Upload file"&gt;
  </code></pre>
  
  <p>Here is my component code,</p>
  
  <pre><code>fileChange(event) {
  
      let fd:FormData=new FormData();
      fd.append("photo",event.target.files[0]);
  
      let headers=new Headers();
      headers.append("Content-Type","multipart/form-data");
      headers.append("Accept","application/json");
      headers.append("Access-Control-Allow-Origin","true");
  
  
      let options=new RequestOptions({headers:headers});
  
  
      this.http.post("https://api.foursquare.com/v2/users/self/update?oauth_token=myauthtoken&amp;v=20160108",fd,options)
      .map(response=&gt;response.json())
      .subscribe(                                      
               data=&gt;console.log(data),
               error=&gt;console.log(error)                                     
      );
  }
  </code></pre>
  
  <p>I am getting <strong>405 (Method Not Allowed)</strong> and <strong>Response for preflight has invalid HTTP status code 405</strong> errors in the console.</p>