title: How can I use Tidhttp to make a Get request with a parameter called xml?
body: <p>I've been successfully using Delphi 2010 to make an http get requests, but for one service that expects a parameter called 'xml' the request fails with a 'HTTP/1.1 400 Bad Request' error.</p>
  
  <p>I notice that calling the same service and omitting the 'xml' parameter works.</p>
  
  <p>I have tried the following with no success:</p>
  
  <pre><code>HttpGet('http://localhost/Service/Messaging.svc/SendReports/PDF?xml=&lt;?xml version="1.0"?&gt;&lt;email&gt;&lt;message&gt;&lt;to&gt;email@internal.com&lt;/to&gt;&lt;from&gt;from@internal.com&lt;/from&gt;&lt;/message&gt;&lt;/email&gt;&amp;id=42&amp;profile=A1');
  </code></pre>
  
  <p>...</p>
  
  <pre><code>function TReportingFrame.HttpGet(const url: string): string;
  var
    responseStream : TMemoryStream;
    html: string;
    HTTP: TIdHTTP;
  begin
    try
        try
          responseStream := TMemoryStream.Create;
          HTTP := TIdHTTP.Create(nil);
          HTTP.OnWork:= HttpWork;
          HTTP.Request.ContentType := 'text/xml; charset=utf-8';
          HTTP.Request.ContentEncoding := 'utf-8';
          HTTP.HTTPOptions := [hoForceEncodeParams];
          HTTP.Request.CharSet := 'utf-8';
          HTTP.Get(url, responseStream);
          SetString(html, PAnsiChar(responseStream.Memory), responseStream.Size);
          result := html;
        except
          on E: Exception do
              Global.LogError(E, 'ProcessHttpRequest');
        end;
      finally
        try
          HTTP.Disconnect;
        except
        end;
      end;
  end;
  </code></pre>
  
  <p>Calling the same url with the parameter name 'xml' renamed to anything else, like 'xml2' or 'name' with the same value as above also works. I have also tried multiple combinations of the charset, but I think the indy component is changing it internally.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The service expects: </p>
  
  <pre><code>[WebGet(UriTemplate = "SendReports/{format=pdf}?report={reportFile}&amp;params={jsonParams}&amp;xml={xmlFile}&amp;profile={profile}&amp;id={id}")]
  </code></pre>
  
  <p>Has anyone had any experience with this?</p>
  
  <p>Thanks</p>