PUT handler

[sdks/expressjs/utils/PUT handler]


Receives PUT requests on the specified route and dispatches the corresponding response. Example:

  1. "my-express-server"@0 received on app ID

  2. "/users/"@0 received on route

  3. a client POST request received by express with URL "http://api.mydomain.com/users/2

  4. the following signals are sent to other node(s) processing the request

  • { "accept": "application/json" }@0 sent on headers

  • { id:2, "name": "John Doe", "age": 29 }@0 sent body

  1. The following signals are received back from processing nodes and sent out to the client:

  • 200@0 on status,

  • { "content-type": "application/json" }@0 on headers,

  • { id:2, "name": "John Doe", "age": 29 }@0 on body

  1. null@0 sent on done


Keywords: api, request, response

Input ports

  • app ID: string

    The id of the express instance. Example: "my-express-server"

  • route: (string or string[])

    Receives the route(s) to handle requests for. Route be specified as exact match (1) or as pattern match (2). Example:

    1. "/status" will just match "/status"

    2. "/s*s" will match "status", "shoes", etc..

  • status: number

    Receives the HTTP status code to be sent with the response to the client. Example: 200

  • headers: {string: string}

    Receives the HTTP headers to be sent with the response to the client. Example: { "content-type": "application/json" }

  • body: any

    Receives the content to send to the client as response body. Example:

    • "OK"

    • 3.14

    • { "status": "OK" }

Output ports

  • headers: {string: string}

    Forwards the headers of the request to be processed. Example: { "content-type": "application/json" }

  • body: any

    Forwards the body of the request to be processed. Example:

    • "OK"

    • 3.14

    • { "status": "OK" }

  • done: any

    Event triggered when the request has been processed.

Last updated