Shayton Equilibrium Kitchen Utensil 2003 User Manual

Page of 194
34 
 Chapter 3 
• 
• 
• 
Example
Suppose that a file parameter is passed to a script with a parameter name of “testFile”. This 
file can be accessed within a script as follows:
var path = req.getFileParamPath("testFile");
var m = new Media();
m.load(name @ path);
g e t H e a d e r N a m e s ( )  
Returns an array of all HTTP header names for the current request. 
Syntax
req.getHeaderNames(); 
Parameters
This function has no parameters.
Example
function main() { 
var respText = new TextResponse(TextResponse.TypePlain); 
var headers = req.getHeaderNames();
for (var i = 0; i < headers.length; ++i) 
respText.append(headers[i] + ": " + 
req.getHeader(headers[i]) + "\n"); 
resp.setObject(respText, RespType.Streamed); 
Sample Output
accept: */* 
accept-encoding: gzip, deflate 
accept-language: en-us 
connection: Keep-Alive 
host: localhost 
user-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 
Q312461) 
g e t R e q u e s t U R L ( )
Returns the full MRL that originated the request.
Syntax
var url = req.getRequestURL();
Parameters
This function has no parameters.