title: How to create folders using MS OneDrive API from Delphi
body: <p>I need to create folders and sub folders on OneDrive using Delphi, so I used indy http component like this </p>
  
  <pre><code>var
  Params, response: Tstringstream;
  Scopes: string;
  begin
    IdHTTP1.Request.ContentType := 'application/json';
    IdHTTP1.HandleRedirects := true;
  
    Scopes := 'scope=onedrive.readwrite,wl.offline_access,wl.signin';
    //&amp;scope={scope}
    idHTTP1.Get('https://login.live.com/oauth20_authorize.srf?client_id=000000000000008D&amp;'+Scopes
      +'&amp;response_type=token&amp;redirect_uri=https://login.live.com/oauth20_desktop.srf');
  
    response := Tstringstream.Create;
    Params := Tstringstream.Create('name=FolderA&amp;folder: { }&amp;@name.conflictBehavior:rename');
    idHTTP1.Post('https://api.onedrive.com/v1.0/drive/root/children', Params, response);
  </code></pre>
  
  <p>I need now to create folders and sub folders how I can do this ?</p>
  
  <p>Here is a syntax from documentation to create a folder but I dont know how to write inside Delphi</p>
  
  <pre><code>POST /drive/root/children
  Content-Type: application/json
  
  {
    "name": "FolderA",
    "folder": { },
    "@name.conflictBehavior": "rename"
  }
  </code></pre>
  
  <p><strong>Update</strong>:
  I tried to get access token like this <code>response := idHTTP1.Get(...);</code> but all I got is HTML text, any idea how to get access token ?</p>