api request for the socket

This block is part of the realtime group and was last modified in core v15.0.3.

api request for the socket v15.0.3

Sends a request to this core's own API on behalf of the socket of the run, in process: the route sees the socket's address, user agent and host.

In pins 5 + flow
  • flow
  • method value

    GET, POST, PUT, PATCH or DELETE. Defaults to POST.

  • path value required

    A path under /api/, without the entity, e.g. /api/v1/auth/login.

  • body object

    Sent as JSON. Not sent with GET.

  • query object
  • token value

    An access token to send the request with. Without it the request is anonymous.

Out pins 4 + flow
  • flow
  • success condition

    The route answered with a 2xx status.

  • status number
  • body object

    The route's answer: decoded JSON, or text.

  • error value

For a socket method that must reach one of the core's own HTTP routes for its client: a sign-in (/api/v1/auth/login), a renewal, a verification code. The request runs through the whole router in process, as the same request over HTTP from the socket's client would: the socket's address is the client address every ban and rate budget counts, and the request carries only the token given in the token pin (none: an anonymous request). The socket is always the run's own; on a run without one the block reports NO_SOCKET. path starts with /api/ and names no entity (the socket's entity is used). success is true for a 2xx status; a route's refusal is not an error: read status and body. error is set only when no request was made or no answer could be read (NO_SOCKET, API_NOT_AVAILABLE, BAD_PATH, BAD_METHOD, BAD_BODY, BAD_QUERY for a query that carries access_token, RESPONSE_TOO_LARGE, CANCELLED). Skipped in a simulation.

Version history

Introduced in v15.0.3.


Back to realtime Return to the main group to view all sub-groups Back to socket Return to the group to view all blocks within this group