Responses

Inspecting responses

Read a response's status, body and headers, and copy or save what you need.

Overview

The response inspector shows the latest response to the selected request. Before you send a request, it shows Awaiting Response. Earlier responses, including those from before you last quit Relay, are in History.

At the top of the inspector, the status badge shows the response's status code and reason, such as 200 OK, colored by the kind of status. When a request gets no response, the badge shows why instead, such as "The request timed out." Next to the badge, the tabs show the details:

  • Body: The response body.
  • Events: The events of a server-sent event stream. This tab appears only for a stream. For more information, see Receiving server-sent events.
  • Headers: The headers Relay sent and the headers the server returned.
  • Timeline: How long each stage of the request took, with the total time on the tab. For more information, see Measuring request timing.
  • Tests: The results of the request's tests and its scripts' console output. The tab shows how many tests passed, in red when any failed. For more information, see Testing responses.

The bar at the top of the inspector can also show these capsules:

  • Streaming: The response is an event stream that's still open.
  • Redirects: Relay followed one or more redirects to get the response, such as "2 Redirects". Hold the pointer over it to see the chain of statuses, or click it to open the Headers tab.
  • Not Verified: The server's certificate isn't trusted, and Relay accepted it because certificate verification is off for the request.

Read the body

Click Body. The menu at the top of the tab chooses how the body appears:

  • Pretty: Formats the body for reading. JSON is indented, with its object keys sorted. HTML is re-indented, and XML is highlighted as it arrived. Other text appears as it arrived.
  • Raw: Shows the body as text, exactly as it arrived.

For an image, audio, video, PDF, font or archive, the first option is called Preview. An image appears as a picture. A body that isn't text shows its size and a Save to File… button.

Relay formats HTML bodies up to 8 MB; a larger one appears as it arrived. Text larger than 128 KB appears without syntax colors. When a body is empty, the tab shows Empty Response.

If the request has a GraphQL body and the response contains GraphQL errors, a banner above the body lists them. For more information, see Sending GraphQL queries.

Copy or save the body

The buttons at the top of the Body tab act on the body exactly as it arrived, not as it's formatted:

  • Click the Copy Response button to copy a text body to the clipboard.
  • Click the Save Response button to save the body to a file.

Read the headers

Click Headers. The tab shows a card for each part of the exchange:

  • Request Headers: The method, the full URL and the HTTP version, then the headers Relay actually sent, including those added by authentication, cookies and Relay's defaults. When the request went through a custom proxy or presented a client certificate, the card says so.
  • Redirect cards: One card for each redirect Relay followed, such as Redirect 1, with its status, the request it answered and its headers. These cards start collapsed; expand one to see its headers.
  • Response Headers: The status and the headers the server returned. After redirects, the card also shows the URL the response came from.

To copy a card's headers as Name: value lines, click the card's copy button, such as Copy Request Headers. To save them to a text file, click its save button, such as Save Request Headers.

Fix certificate problems

When a request fails because the server's certificate isn't trusted, the Body tab shows a banner. To accept the certificate, click Turn Off Certificate Verification for This Request, then send the request again. To turn verification back on, choose Edit > Undo or change Verify Certificates in the request's Settings tab.

When the server asks for a client certificate the request didn't present, the banner offers Open Certificates, which opens the workspace's Certificates tab in the Workspaces window. Add a certificate for the host there, then send again. For more information, see Using client and CA certificates.

See Also