Monday, November 08, 2010 at 12:06 AM.

system.verbs.builtins.webserver.responders.echo.methods.GET

<<Script: system.verbs.builtins.webserver.responders.echo.methods.GET; Version 1; Date: Wed, 13 May 1998 06:21:43 GMT; ID: RAB
on get (adrParamTable) {
	<<March 03, 1998 at 9:36:20 PM by WMF
		<<This is a debugging responder that echos all the parameters that are available to a responder 
		<<It is similar to the samples.tellParams CGI
	
	local (response, i);
	on add (s) {
		response = response + s + cr};
	on addVar (name, val) {
		response = response + "<B>" + name + ":</B> " + string(val) + "<BR>\r"};
	
	response = "";
	add ("<HTML><HEAD><TITLE>Parameters Received</TITLE></HEAD><BODY>");
	
	bundle { // show general parameters (those at the top level of adrParamTable)
		add ("<H3>General Parameters:</H3>");
		for i = 1 to sizeOf (adrParamTable^) {
			if (typeOf (adrParamTable^[i]) != tableType) {
				addVar (nameOf (adrParamTable^[i]), adrParamTable^[i])}}};
	bundle { // show the request headers (things at adrParamTable^.requestHeaders)
		add ("<H3>Request Headers:</H3>");
		for i = 1 to sizeOf (adrParamTable^.requestHeaders) {
			addVar (nameOf (adrParamTable^.requestHeaders[i]), adrParamTable^.requestHeaders[i])}};
	
	add ("</BODY></HTML>");
	
	adrParamTable^.responseHeaders.["Content-Type"] = "text/html"; // always set the MIME type
	
	adrParamTable^.responseBody = response;
	
	return (true)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.