How requests are relayed
The browser does not send your request directly. It sends it to Nimbus, and Nimbus sends it to your API.
The flow
- You click Send.
- The browser posts the request to the Nimbus relay endpoint.
- Nimbus resolves variables, adds authentication, and sends the request with an HTTP client.
- Nimbus reads the response, including headers, cookies, and redirects.
- Nimbus returns the result to the browser.
Why a relay
- The browser cannot read cookies from
Set-Cookieheaders or decrypt them. Nimbus can. - Cross-origin rules do not apply to a server side request.
- Nimbus can act as a user of your application, switch the clock, or roll back the database, because it runs inside your application.
- Nimbus adds a CSRF token header to requests for the current host when you did not set one.
Which host receives the request
Requests go to the base URL of the active environment. For the current host, this is base_url, or the host of the page when base_url is null. When the target is the same server that handles the relay, a single-threaded server cannot answer both. See Single-threaded servers.
Limits
Features that need your application, such as impersonation, cookie decryption, and Insight, work only when the target is the current host. Other environments receive the request as written.