title: Error 400 - "Required" on Google Storage
body: <p>I'm having a problem with Google Cloud Storage API. I'm using curl, but I get a 400 error like this:</p>
  
  <blockquote>
    <p>{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Required" } ], "code": 400, "message": "Required" } }</p>
  </blockquote>
  
  <p>Unfortunately, I cannot find a solution, as on the internet there's nothing like "Required" error.</p>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>$GOOGLE_API_KEY = "My-API-Key";
  
  $url = "https://www.googleapis.com/upload/storage/v1/b/img.artphototravel.com/o?key=".$GOOGLE_API_KEY;
  
  $curl = curl_init();
  curl_setopt_array($curl, array(
    CURLOPT_RETURNTRANSFER =&gt; true,
    CURLOPT_HTTP_VERSION   =&gt; CURL_HTTP_VERSION_1_1,
    CURLOPT_URL            =&gt; $url,
    CURLOPT_POST           =&gt; true,
    CURLOPT_POSTFIELDS     =&gt; array(
      "uploadType"    =&gt; "media",
      "name"          =&gt; "test.jpg"
    )
  ));
  
  //Headers
  $headers = array();
  $headers[] = "Content-Type: image/jpeg";
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  
  $resp = curl_exec($curl);
  curl_close($curl);
  </code></pre>
  
  <p>Can anyone help my to figure out a solution? Thank you so much.</p>