title: How to make a post request to box.com API with laravel?
body: <p>I'm trying to make a post request from my controller to the Box.com API. The request will upload a file to my Box.com account. The following code is on my view:</p>
  
  <pre><code>&lt;form action="/accept" method="post" enctype="multipart/form-data"&gt;
      {{ csrf_field() }}
  
      &lt;input type="file" name="filename"&gt;
      &lt;input type="text" name="parent_id" value="0"&gt;
  
      &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my controller, I'm not getting any clue of how can I send the post request to the box.com API which will send the form data with an authorization header. The Box.com API require the authorization header to accept the request.</p>
  
  <p>However, in Laravel documentation they've a section where I found the following code:</p>
  
  <pre><code>return response($content)
          -&gt;header('Content-Type', application/json)
          -&gt;header('Authorization', 'Bearer XXXXXXXXXXXXXXXX');
  </code></pre>
  
  <p>I can set the authorization header using this however, how the form data would be send then?</p>
  
  <p>Here's the Box.com API URL to accept the post request:</p>
  
  <pre><code>https://upload.box.com/api/2.0/files/content
  </code></pre>