title: How to upload files with Guzzle (OAuth 2)
body: <p>I'm trying to upload files using Guzzle HTTP client and send it to the API URL. However, I couldn't get success over this. I can use Curl however, I want to use Guzzle. I couldn't figure out where to add the uploading files with the Guzzle and how to use the attributes. Here's the relevant Curl code:</p>
  
  <pre><code>curl https://upload.box.com/api/2.0/files/content \
    -H "Authorization: Bearer ACCESS_TOKEN" -X POST \
    -F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
    -F file=@myfile.jpg
  </code></pre>
  
  <p>Here's the reference API docs which I hope you'll find helpful. I'm using Laravel 5.</p>
  
  <p>No matter what I do everytime I'm getting <code>Method not allowed</code> response. Here's the following code I'm trying:</p>
  
  <pre><code>$client = new Client();
          $sendRequest = $client-&gt;post('https://upload.box.com/api/2.0/files/content', [], [
              'request.options' =&gt; [
                  'headers' =&gt; [
                      'Authorization' =&gt; 'Bearer ' . $access_token
                  ]
              ],
              'file' =&gt; '/picture.jpg'
          ]);
          $sendRequest-&gt;setBody('{"attributes": {"name": "picture.jpg", "parent": {"id": "5605448193"}}}');
  try {
      $response = $sendRequest-&gt;send();
      dd($response);
  } catch(BadResponseException $e) {
          dd($e-&gt;getResponse());
      }
  </code></pre>