$Web Num Hdr: Difference between revisions
m (1 revision) |
m (1 revision) |
||
Line 35: | Line 35: | ||
<ul> | <ul> | ||
<li>[[$Web_Hdr_Len]] | <li>[[<var>$Web_Hdr_Len]]</var> | ||
<li>[[$Web_Hdr_Name]] | <li>[[<var>$Web_Hdr_Name]]</var> | ||
<li>[[$Web_Hdr_Parm]] | <li>[[<var>$Web_Hdr_Parm]]</var> | ||
</ul> | </ul> | ||
[[Category:Janus Web Server $functions|$Web_Num_Hdr]] | [[Category:Janus Web Server $functions|$Web_Num_Hdr]] |
Revision as of 20:17, 12 June 2012
<section begin="desc" />Number of fields in request header<section end="desc" />
$Web_Num_Hdr retrieves the number of fields in a request header.
Syntax
<section begin="syntax" /> %COUNT = $Web_Num_Hdr( fieldname ) <section end="syntax" />
$Web_Num_Hdr takes a single optional argument and returns a number.
fieldname | Specifies to count only the header fields that match fieldname. If omitted, returns the count of all header fields. |
---|
While many header fields are handled "under the covers" by Janus Web Server, there might be useful application level information in some header fields. The following code shows how an application might use the $Web_Num_Hdr function to send the contents of all header fields to the audit trail. While this could be done with JANUS TRACE settings, it might be useful to do this on an application level.
IF %BAD_REQUEST THEN %H_COUNT = $Web_Num_Hdr FOR %X FROM 1 TO %H_COUNT AUDIT $Web_Hdr_Parm(, %X) END FOR %RC = $Web_Done(500, - 'Bad header data received') STOP END IF
See also:
- [[$Web_Hdr_Len]]
- [[$Web_Hdr_Name]]
- [[$Web_Hdr_Parm]]