title: Get a public link after uploading to Google Cloud Storage using JavaScript Client
body: <p>I used Google Cloud Storage JavaScript Client Library to upload a file to Google Cloud Storage. Then I want to get a public link that I want to share with my friends without needing Google account. I tried to reuse <a href="https://cloud.google.com/storage/docs/json_api/v1/json-api-javascript-samples" rel="nofollow">the JavaScript example</a> with insertObject as the following codes:</p>
  
  <pre><code> var request = gapi.client.request({
            'path': '/upload/storage/' + API_VERSION + '/b/' + BUCKET + '/o',
            'method': 'POST',
            'params': {'uploadType': 'multipart'},
            'x-goog-acl','public-read',
            'headers': {
              'Content-Type': 'multipart/mixed; boundary="' + boundary + '"'
            },
  </code></pre>
  
  <p>Upload successfully in my google cloud storage bucket (myphoto_upload). But I can not access via <a href="https://storage.cloud.google.com/myphoto_upload/brv_brown.png" rel="nofollow">https://storage.cloud.google.com/myphoto_upload/brv_brown.png</a>. I tried to replace <code>'x-goog-acl','public-read'</code>, with <code>'acl' : [{'entity': 'allUsers', 'role': 'READER'}],</code>
          OR <code>'body':{'entity': 'allAuthenticatedUsers', 'role': 'READER'}</code>, But the result is the same. Thank for your help in advance.</p>