title: Insert object to Google Cloud Storage using PHP
body: <p>To be honest, I am really frustrated with the lack of document of Google Cloud Storage with PHP. Most of what I found in here (Stackoverflow) is out of date.</p>
  
  <p>Here is my attempt:</p>
  
  <pre><code>$postbody = array('data' =&gt; file_get_contents('e.png'));
  $gso = new Google_Service_Storage_StorageObject();
  $gso-&gt;setName('testing');
  $gso-&gt;setContentType('images/png');
  
  $service-&gt;objects-&gt;insert($bucket_name, $gso, $postbody);
  </code></pre>
  
  <p>The error message</p>
  
  <blockquote>
    <p>(400) Upload requests must be sent to /upload/*. Re-send request to the same path, but with an /upload prefix.</p>
  </blockquote>
  
  <p>From Google Cloud Storage JSON API, I understand that I need to use <code>upload/storage/v1/b/bucket_name/o</code> instead of <code>storage/v1/b/bucket_name/o</code>, but how do I do it with Google Cloud Storage PHP Client API?</p>