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 */*
ACCEPT-ENCODING gzip, br, zstd, deflate
HOST v-2052.easyco.net:50000
MAX-FORWARDS 10
USER-AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
X-CONNADDR 38.123.135.106:20480 18.119.28.173:51244
X-FORWARDED-FOR 18.119.28.173
X-FORWARDED-HOST coyote.modsoft.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:  Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
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.