Modular Software - Home PicLan-IP - Home

Using HTTP Header Fields

When a web browser retrieves a web page, a number of HTTP header fields are included with each page request.  These fields vary from browser to browser, but can be used by Coyote applications to control page processing. Here is an example of the HTTP header fields that are sent to the Coyote web server by your browser:
ACCEPT */*
HOST v-2052.easyco.net:50000
MAX-FORWARDS 10
USER-AGENT claudebot
X-CONNADDR 38.123.135.106:20480 44.202.183.118:42137
X-FORWARDED-FOR 44.202.183.118
X-FORWARDED-HOST piclan.com
X-FORWARDED-SERVER v-2022.easyco.net


This table is built live with the actual values that your browser generated.  It is also possible that any intervening HTTP proxy server may have also added header fields.

There are two basic techniques for querying HTTP header fields. You can query single fields with the statement:

PL_GET_HDR var FROM 'field name' ELSE ...
An example of using this statement is here:
PL_GET_HDR USER.AGENT FROM 'USER-AGENT' ELSE USER.AGENT = 'Undefined'
Your user-agent is:  claudebot
This statement is ideal for specifically querying a single header field value.  If you want to see all of the values, you can look directly at the Coyote common variables where these values are stored:
ST$HTTP.HDR This is a dynamic array of values that contains the names of each existing header field.  If the same header field name occurs multiple times, then only a single entry in the ST$HTTP.HDR variable will be entered.
ST$HTTP.VAL This is a dynamic array of values that contains the values of each existing header field.  If the same header field name occurs multiple times, then each instance will be stored as a seperate sub-value in this variable.
If you would like to see how this page queries the HTTP headers, you can look here.

Modular Software - Home PicLan-IP - Home

© Copyright 1996-1998  Modular Software Corporation.All rights Reserved.