NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_parsemessage(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_parsemessage - Parse an HTTP message

Table Of Contents

Synopsis

Description

This function parses a full HTTP message (first line, headers, and body) into a Tcl dictionary and parses the header fields into a new case-insensitive ns_set. The implementation cares about folded (multi-line) header fields.

COMMANDS

ns_parsemessage message

The result of this command is a Tcl dictionary containing the following elements.

firstline

headers

body

EXAMPLES

 % ns_parsemessage HTTP/1.1 200 OK
content-length: 2

OK
 firstline {HTTP/1.1 200 OK} headers d0 body OK
 
 % ns_set format d0
 headers:
   content-length: 2

See Also

ns_parsefieldvalue, ns_parseheader, ns_parseurl, ns_set, nsd

Keywords

HTTP, NaviServer, global built-in, parse