Skip to content

httpPost

Back to Index
httpPost(uri: string): {
headers: { text -> text } | nothing
body: text | nothing
}

httpPost effects allows a Reactor to make external HTTP POST requests.

Return Type

The effect will return the result from the request:

:{
statusCode: number
contentType: text
content: text
}

Security

All external requests must be done using HTTPS. It’s possible to restrict which hostnames are allowed on a system level by setting the reactors/effects/httpRequest/allowedHosts

Examples

POST request

from {
method = args => httpPost('https://example.com') with {
headers = {
'Authorization' -> 'Bearer <token>'
}
body = {
field = 'value'
} asJson
}
}
Back to Index