Add HTTP endpoints to your Magma agents
@hook
decorator:
req.query
- URL query parametersreq.body
- POST request bodyreq.headers
- HTTP headersreq.params
- URL parametersres
object to send a response to the caller.
res.status(code).json(body)
- Send a JSON responseres.send(body)
- Send a string or buffer responseres.end()
- End the responseuserId
in the request body.
To learn more about sessions, see the Sessions page.