title: Delphi XE6 post request and indy
body: <p>I have a Delphi XE6 application which I would like to install on an Android phone. I am testing it on a Windows platform. Below is my unit source code. On my form I have a button, idHttp Indy tool and a Memo Field.</p>
  
  <p>The problem is that when I click the button I get the error</p>
  
  <blockquote>
    <p>HTTP/1.1 403 Forbidden.</p>
  </blockquote>
  
  <p>But I can access the site through my browser, so the page isn't forbidden.
  Can anyone see a problem?</p>
  
  <p>I have searched for how to do post requests using firemonkey and delphi and I found these links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2977720/how-to-send-a-http-post-request-in-delphi-2010-using-wininet">How to send a HTTP Post Request in Delphi 2010 using WinInet</a></li>
  <li><a href="https://stackoverflow.com/questions/18560799/post-request-in-delphi-xe">POST request in Delphi XE</a></li>
  <li><a href="https://stackoverflow.com/questions/14551194/how-are-parameters-sent-in-an-http-post-request">How are parameters sent in an HTTP POST request?</a></li>
  </ul>
  
  <p>None of which help me.</p>
  
  <pre><code>unit Start_Interface_u;
  
  interface
  
  uses
    System.SysUtils, System.Types, System.UITypes, System.Classes,
    System.Variants,
    FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
    IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
    FMX.Layouts, FMX.Memo;
  
  type
    TForm1 = class(TForm)
      btnLogin: TButton;
      IdHTTP1: TIdHTTP;
      Memo1: TMemo;
      procedure btnLoginClick(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
  
  var
    Form1: TForm1;
  
  implementation
  
    {$R *.fmx}
  
  
    procedure TForm1.btnLoginClick(Sender: TObject);
    Var
      sResult: String;
      DataToSend :TStringList;
    begin
  
    DataToSend := TStringList.Create;
    //DataToSend.Add('login_email=some_email');
    //DataToSend.Add('login_pass=some_password');
    IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
  
    Memo1.Lines.Add(idHTTP1.Post('http://mysite.co.za/dash.php', DataToSend));
  
    end;
  
  end.
  </code></pre>