title: How to set body data indy HTTPS post
body: <p>So I've looked around, and the only question describing my problem is 6 years old with 0 answers, so I guess I will try again.</p>
  
  <p>I am using delphi 2009 with Indy10.</p>
  
  <p>I am trying to post <code>JSON</code> to an api using HTTPS.</p>
  
  <pre><code>Instance.FHTTP := TIdHTTP.Create;
  Instance.FHTTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(Instance.FHTTP);
  
  {$IFDEF DEBUG}
  Instance.FHTTP.ProxyParams.ProxyPort := 8888;
  Instance.FHTTP.ProxyParams.ProxyServer := '127.0.0.1';
  {$ENDIF}
  
  Instance.FHTTP.Request.ContentType := 'application/json';
  Instance.FAccessToken := Instance.FHTTP.Post('https://somedomain.com/api/endpoint', '{JSONName: JSONValue }' );
  </code></pre>
  
  <p>I have seen many answers suggesting that the <code>JSON</code> payload should be given as a <code>string</code> param in the <code>TidHTTP.Post</code>method, but when i try that, it expects a filepath, and throws an error saying:</p>
  
  <blockquote>
    <p>'Cannot open file "[path to project{JSONName:JSONValue }]". The specified file was not found'.</p>
  </blockquote>
  
  <p>If i add my <code>JSON</code> to a <code>TStringList</code> and add give that as a parameter, it simply adds the JSON to the header of the request.</p>
  
  <p>Any help is greatly appreciated.</p>