title: Google Drive API Duplicate Folder Created
body: <p>Faced this strange issue while creating a folder using the google drive API. The number of requests being sent from the browser is only 1 and as part of the response I get a single folder created. But after about 5-10 seconds the second folder is created automatically.  </p>
  
  <p>The request payload contains the following request  </p>
  
  <blockquote>
    <p>({mimeType: "application/vnd.google-apps.folder", parents: [{id: "root"}], title: "expenseapp"})</p>
  </blockquote>
  
  <p>The javascript Code being executed is mentioned below. Unable to figure out why two folders are created as part of this request. The same request when posted through the google Try it link <a href="https://developers.google.com/drive/v2/reference/files/insert" rel="nofollow">Google Try It Link</a>, creates only a single folder. Went through the request line by line too and could find only <code>(x-client-data:CKi1yQEIjbbJAQimtskBCKm2yQEIwbbJAQjuiMoBCLaVygE=)</code> this additional header info when posted from the Try it link which was not present when this was posted programatically  </p>
  
  <pre><code>    var CLIENT_ID = "&lt;CLINET ID&gt;";
      var API_KEY = "AIzaSyAUHmII94uYsdu8_V_P-bRXkGQECKwPun8";
      var SCOPES = ["openid", "profile", "email", "https://www.googleapis.com/auth/drive"];
      gapi.client.setApiKey(API_KEY);
      var _this = this;
      gapi.auth.authorize({'client_id' : CLIENT_ID,'scope': SCOPES,'immediate': true},function(){
          console.log('Entered');
          gapi.client.load('drive', 'v2',_this.createFolder );
      });
  createFolder : function(){
          var auth = 'Bearer accessToken';
          var _this = this;
          var request = gapi.client.request({
              path : 'https://www.googleapis.com/drive/v2/files',
              method : 'POST',
              params : "",
              headers : {
                  'Authorization' : auth,
                  'Content-Type': 'application/json'
              },
              body : {
                  "mimeType": "application/vnd.google-apps.folder",
                  "parents": [{"id":"root"}],
                  "title" : "expenseapp"
              }
          })
           request.execute(function(resp){
              console.log('Created File id :'+resp.id);
           })
  
  
  }
  </code></pre>