Responses
5 nodes
On this page 5
Html Response
FunctionA web page: the HTML as it is, sent as text/html. Values from a visitor go in through HTML Encode.
Signature
HtmlResponse -> EndpointResponse
HTML: Text
statusCode: IntegerEndpointResponse HtmlResponse(string html, int statusCode = 200)
Parameters
| name | type | default | description |
|---|---|---|---|
| HTML | Text | — | |
| statusCode | Integer | 200 |
Returns
| Response | EndpointResponse |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Responses
- Package
- Web Applications
Json Response
FunctionA JSON answer: the text as it is, sent as application/json.
Signature
JsonResponse -> EndpointResponse
JSON: Text
statusCode: IntegerEndpointResponse JsonResponse(string json, int statusCode = 200)
Parameters
| name | type | default | description |
|---|---|---|---|
| JSON | Text | — | The JSON - from a database result's To Json, a table's To JSON, or Format with JSON String for each value. |
| statusCode | Integer | 200 | 200 for an answer, 201 for something created, 400 for a request that was wrong, 404 for nothing there. |
Returns
| Response | EndpointResponse |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Responses
- Package
- Web Applications
Redirect
FunctionSends the visitor's browser to another address - after a form is posted, to the page that shows the result (303, See Other).
Signature
Redirect -> EndpointResponse
location: Text
statusCode: IntegerEndpointResponse Redirect(string location, int statusCode = 303)
Parameters
| name | type | default | description |
|---|---|---|---|
| location | Text | — | Where to go: a path on this server (/entries) or a full address. |
| statusCode | Integer | 303 | 303 after a form post (the browser then asks with GET), 302 or 307 for a temporary move, 301 or 308 for a permanent one. |
Returns
| Response | EndpointResponse |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Responses
- Package
- Web Applications
Text Response
FunctionA plain text answer.
Signature
TextResponse -> EndpointResponse
text: Text
statusCode: IntegerEndpointResponse TextResponse(string text, int statusCode = 200)
Parameters
| name | type | default | description |
|---|---|---|---|
| text | Text | — | |
| statusCode | Integer | 200 |
Returns
| Response | EndpointResponse |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Responses
- Package
- Web Applications
With Header
FunctionThe same response with one more header - a Location, a Set-Cookie, a Cache-Control - replacing one of the same name.
Signature
WithHeader -> EndpointResponse
response: EndpointResponse
name: Text
value: TextEndpointResponse WithHeader(
EndpointResponse response,
string name,
string value)Parameters
| name | type | default | description |
|---|---|---|---|
| response | EndpointResponse | — | |
| name | Text | — | |
| value | Text | — |
Returns
| Response | EndpointResponse |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Responses
- Package
- Web Applications