Request Fields
Most Request fields should be considered read-only and are intended to convey information about the request to your endpoints.
ContentType
| Description |
ContentType is the request's payload content type specified in the content-type header. charset contains any charset specified in the content-type header. |
| Default |
'' |
Charset
| Description |
Charset is the character set, if any, specified in the content-type header. |
| Default |
'' |
| Notes |
If Charset is 'utf-8', Jarvis will do the proper UTF-8 conversion to the request payload. |
Body
| Description |
Body is the raw body of the request after any UTF-8 conversion, if needed. |
| Default |
'' |
| Notes |
The difference between Body and Payload is that Payload will have undergone any appropriate translation whereas Body won't. For example, if the ContentType is 'application/json', Body might be [1,2,3] whereas Payload would be the APL array 1 2 3. Similarly, if the ContentType is 'multipart/form-data' or 'application/x-www-form-urlencoded', Body contain the raw character data whereas Payload will be a namespace containing the named elements specified in the Body. |
Endpoint
| Description |
Endpoint is the endpoint specified in the request's URL, without any query string. |
| Default |
'' |
| Notes |
In JSON mode, Endpoint is the name of the function that will be called when servicing the request. |
| Description |
Headers is a 2-column matrix of the request's [;1] header names, [;2] header values. |
| Default |
0 2⍴'' '' |
| Notes |
The GetHeader method can be used to retrieve header values by name. |
Method
| Description |
Method is the HTTP method used for the request. |
| Default |
'' |
| Notes |
In JSON mode, this will normally be POST. In REST mode, the HTTP method specifies the function to be called to service the request as specified in RESTMethods. |
IsSSE
| Description |
IsSSE is a Boolean that indicates whether the request is for one of the Server-Sent Events endpoints named in SSEEndpoints. Valid values are:0 - an ordinary request1 - a request for an SSE endpoint
|
| Default |
0 |
| Example(s) |
An AuthenticateFn that checks event streams differently, because the browser's EventSource can't send an Authorization header. CheckToken and CheckLogin stand for your own functions, returning 0 for success:
∇ r←Authenticate req
[1] :If req.IsSSE
[2] r←CheckToken req ⍝ e.g. a token in req.QueryParams
[3] :Else
[4] r←CheckLogin req
[5] :EndIf ∇ |
| Notes |
Jarvis sets IsSSE after calling ValidateRequestFn, just before it handles the SSE request. So it's always 0 in ValidateRequestFn, and 1 in AuthenticateFn, SessionInitFn and the SSE endpoint function. To recognise an SSE request in ValidateRequestFn, check Endpoint instead. |
Connection
| Description |
Connection is the name of the Conga connection the request arrived on. It can be used as a target for SendSSE to push Server-Sent Events to this client. |
| Default |
'' |
| Notes |
Jarvis sets Connection for every request. For a WebSocket, the connection is reached instead through the connection namespace's conx (see Using WebSockets). |
QueryParams
| Description |
QueryParams is a 2-column matrix of the names and values of the parameters in the request's query string (the part of the URL after ?). |
| Default |
0 2⍴0 (no query parameters) |
| Notes |
For example, a request for /report?from=2026-01-01&fmt=csv gives QueryParams of two rows: from 2026-01-01 and fmt csv. In JSON mode, allowing query-string requests requires AllowGETs. |
UserID
| Description |
UserID is the user name supplied in the request's Authorization header when HTTP Basic authentication is used. |
| Default |
'' |
| Notes |
Set only for a Basic Authorization header (see HTTPAuthentication). Use it in an AuthenticateFn together with Password. |
Password
| Description |
Password is the password supplied in the request's Authorization header when HTTP Basic authentication is used. |
| Default |
'' |
| Notes |
Set only for a Basic Authorization header. See UserID and Security. |
Cookies
| Description |
Cookies is a 2-column matrix of the names and values of the cookies sent with the request. |
| Default |
0 2⍴⊂'' (no cookies) |
| Notes |
Use the GetCookie method to read a cookie by name, and SetCookie to set one on the response. |
PeerCert
| Description |
PeerCert is the client's certificate, when the server is running with TLS (Secure) and the client presented one. |
| Default |
0 0⍴⊂'' (no certificate) |
| Notes |
For a secure server that couldn't obtain the certificate, PeerCert is the text 'Could not obtain certificate'. |
PeerAddr
| Description |
PeerAddr is the IP address of the client that made the request. |
| Default |
'unknown' |
Server
| Description |
Server is a reference to the Jarvis instance handling the request. Use it to reach the instance methods from an endpoint — for example Log, SendSSE or WsSend. |
| Example(s) |
req.Server.Log 'endpoint called' |
Session
| Description |
Session is a reference to this request's session namespace when the service uses sessions, or ⍬ otherwise. Store per-session state in it. |
| Default |
⍬ |
| Notes |
Sessions are enabled with SessionTimeout. See Using Sessions. |
KillOnDisconnect
| Description |
KillOnDisconnect controls what happens to the thread handling this request if the client disconnects before the request finishes. Valid values are:0 - let the handler run to completion1 - kill the handler's thread as soon as the disconnect is detected
|
| Default |
0 |
| Notes |
An endpoint can set req.KillOnDisconnect←1 for a long-running request (for example a looping SSE endpoint) so its thread is stopped promptly when the client goes away. |
| Description |
Input is the raw request target from the request line — the path together with any query string, before URL-decoding and before the query string is split off into QueryParams. |
| Default |
'' |
| Notes |
Endpoint is Input with the query string removed and URL-decoded. |
HTTPVersion
| Description |
HTTPVersion is the HTTP version from the request line, for example 'HTTP/1.1'. |
| Default |
'' |
Payload
| Description |
Payload is the request body after any parsing. When the content-type is application/json or XML and ParsePayload is on, Payload is the APL array converted from the body; for multipart/form-data or application/x-www-form-urlencoded it is a namespace of the named parts. Otherwise it is the raw body. |
| Default |
'' |
| Notes |
The difference between Body and Payload is that Payload has undergone any appropriate translation whereas Body has not. In JSON mode the parsed payload is passed as the right argument to your endpoint function. |
Response
| Description |
Response is a namespace holding the status, headers and payload that Jarvis will send back to the client. See Response Namespace. |