cleanup, docs
This commit is contained in:
@@ -18,12 +18,9 @@ For a request line, the returned map includes fields such as `REQUEST_METHOD`, `
|
||||
|
||||
Example:
|
||||
|
||||
```uce
|
||||
StringMap h = split_http_headers("GET /demo.uce?x=1 HTTP/1.1\r\nHost: example.test\r\n\r\n");
|
||||
// h["REQUEST_METHOD"] == "GET"
|
||||
// h["SCRIPT_NAME"] == "/demo.uce"
|
||||
// h["QUERY_STRING"] == "x=1"
|
||||
// h["HTTP_HOST"] == "example.test"
|
||||
```
|
||||
|
||||
Most page code should read `context.params` instead. Use this helper when parsing raw HTTP text in tests or protocol helpers.
|
||||
|
||||
:example
|
||||
StringMap headers = split_http_headers("Host: example.test\r\nUser-Agent: uce\r\n");
|
||||
print(headers["Host"], "\n");
|
||||
|
||||
Reference in New Issue
Block a user