I'm building a REST system under IIS/ASP which provides general record listings. But I also want to insert into these general listings a URI which allows the client to retrieve each specific record's details. I've come up with the following JScript to build an URI leader which I can then tack on record specific addressing:
<% @LANGUAGE="javascript" %>
<%
var ScriptUrl = Request.ServerVariables("HTTPS") == 1 ? "https://" : "http://";
ScriptUrl += Request.ServerVariables("HTTP_HOST");
ScriptUrl += Request.ServerVariables("SCRIPT_NAME") + "?";
// Record retrieval...
// Update each record with an absolute URI back into this page...
// Return enhanced listing data...
%>
So if the bulk record listing was requested through a URL like:
https://rest.site.com:12345/default.asp?/records
ScriptUrl
would equal https://rest.site.com:12345/default.asp?
Is there a better way to do this under ASP/IIS?