Session.endpoint(Create a custom endpoint at
route: str,
*,
method: Literal[‘DELETE’, ‘GET’, ‘PATCH’, ‘POST’, ‘PUT’] ='GET',
) → Callable[[Callable[[Request, User, Session], JsonValue]], Callable[[Request, User, Session], JsonValue]]
f"/proxy/{route}".
Calling this method overrides
atoti.Session.proxy’s url.- take three parameters with respective types:
- return a response body as JSON convertible data
Parameters
route
The template of the path after"/proxy".
For instance, if "foo/bar" is passed, a request to "/proxy/foo/bar?query=string" will match.
Path parameters can be configured by wrapping their name in curly braces in the template.
method
The HTTP method the request must be using to trigger this endpoint.DELETE, PATCH, POST, and PUT requests can have a body but it must be JSON.
See also:
atoti.Session.proxy.