title: How can I give the response file of a universal HTTP request a unique name?
body: <p>I've developed an HTTP API Server (intended to be called by third-party applications, not necessarily by a web browser) which has one universal call to <code>get</code> (download) any and all types of files by passing a <code>name</code> parameter in the query string for the file requested. All calls, no matter for which file, are handled in the same custom request handler of mine called <code>Get</code> (not to be confused with the standard HTTP <code>get</code>). A query string includes a property <code>name</code> which identifies the unique file to get.</p>
  
  <p>So a request may look like:</p>
  
  <pre><code>http://MyServerURL.com/Get?Key=SomeAPIKeyForAuthentication&amp;Name=SomeUniqueIdentifier
  </code></pre>
  
  <p>First of all, I know I can obviously make the server fetch a file using only the URI, for example...</p>
  
  <pre><code>http://MyServerURL.com/SomeUniqueIdentifier?Key=SomeAPIKeyForAuthentication
  </code></pre>
  
  <p>...but the design is specifically meant to use this one universal <code>get</code> command, so I need to keep this unique identifier in the query string. The actual applications which connect to this API will never need to know this filename, but there may be an event when a URL is manually provided for someone to open in their browser to download a file.</p>
  
  <p>However, whenever a file is downloaded through a web browser, since the call is <code>get</code>, the saved filename also winds up being just <code>get</code>.</p>
  
  <p>Is there any trick in HTTP which I can implement on my server which will force the downloaded filename to be the unique identifier, rather than just <code>get</code>? For example, some method such as using re-direct?</p>
  
  <p>I'm using Indy 10 <code>TIdHTTPWebBrokerBridge</code> in Delphi XE2 as the web server. I'm looking for a way in this component (technically in its corresponding <code>TWebModule</code> handler) when it handles this <code>get</code> request, to make the response's filename whatever string I want (in this case, <code>SomeUniqueIdentifier</code>). I've heard the term "URL Re-writing" but that's a rather different topic, and don't think it's what I need, yet it might.</p>