Divooka Reference

Responses

5 nodes

On this page 5

Html Response

Function

A 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: Integer
EndpointResponse HtmlResponse(string html, int statusCode = 200)

Parameters

nametypedefaultdescription
HTMLText—
statusCodeInteger200

Returns

ResponseEndpointResponse
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Responses
Package
Web Applications

Json Response

Function

A JSON answer: the text as it is, sent as application/json.

Signature
JsonResponse -> EndpointResponse
    JSON: Text
    statusCode: Integer
EndpointResponse JsonResponse(string json, int statusCode = 200)

Parameters

nametypedefaultdescription
JSONText—The JSON - from a database result's To Json, a table's To JSON, or Format with JSON String for each value.
statusCodeInteger200200 for an answer, 201 for something created, 400 for a request that was wrong, 404 for nothing there.

Returns

ResponseEndpointResponse
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Responses
Package
Web Applications

Redirect

Function

Sends 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: Integer
EndpointResponse Redirect(string location, int statusCode = 303)

Parameters

nametypedefaultdescription
locationText—Where to go: a path on this server (/entries) or a full address.
statusCodeInteger303303 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

ResponseEndpointResponse
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Responses
Package
Web Applications

Text Response

Function

A plain text answer.

Signature
TextResponse -> EndpointResponse
    text: Text
    statusCode: Integer
EndpointResponse TextResponse(string text, int statusCode = 200)

Parameters

nametypedefaultdescription
textText—
statusCodeInteger200

Returns

ResponseEndpointResponse
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Responses
Package
Web Applications

With Header

Function

The 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: Text
EndpointResponse WithHeader(
    EndpointResponse response,
    string name,
    string value)

Parameters

nametypedefaultdescription
responseEndpointResponse—
nameText—
valueText—

Returns

ResponseEndpointResponse
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Responses
Package
Web Applications