Reading responses

After a send, the bottom half of the request tab shows what came back: a summary, the body, the headers, the results of your tests and the console output of your scripts.

Before the first send

Until a request is sent for the first time, its response pane shows Will be sent: the request resolved with the active environment, as Postino would send it. It follows your edits as you type, and it never runs a script or touches the network.

  • The method and the final URL, with the query string. A URL without a scheme gets http://, as when it is sent.
  • A row of chips: the active environment (or No environment), how many headers go out, the authorization type, the body type and whether the request has a pre-request or a post-response script.
  • Variables: every variable the request uses, once each, with its value and where it comes from: the environment file (local.env or local.local.env), this session for a value a script set with env.set, or the pre-request script for one it sets with vars.set, which is only known when it runs. Template functions such as {{ uuid() }} are not listed. Values used in the authorization or in a header such as Authorization, and values whose names look secret (containing token, key, secret, password, auth or session), are masked.

A variable that nothing defines shows as undefined, with the files it was looked for in, and turns the card red. A banner then names it, with Define in the active environment, which opens the environment's tab on a new row for it, and Change environment, which opens the Environments panel. With no environment active, the button is Choose environment. Press Ctrl Enter (⌘ Enter on macOS) to send; from then on the pane shows the response.

Summary

At the right of the response tab bar:

Status
The code and its standard reason phrase, such as 200 OK or 404 Not Found. The badge is green for 2xx, blue for 3xx, amber for 4xx and red for 5xx. The reason phrase is the standard one for the code, not the text the server sent.
Time
The total time from opening the connection to reading the last byte, including any redirects. Shown in milliseconds below one second and in seconds above.
Size
The size of the body, after decompression: bytes below 1000, then kB and MB with one decimal. 1 kB is 1000 bytes.

Body

  • Pretty shows a JSON body indented and highlighted, with the JSON indentation of Settings, two spaces by default. Pretty printing works on bodies of any size and is computed once per response, not on every redraw. A body whose shown text is over 4 MB, pretty or raw, is shown without colors.
  • Raw shows the body exactly as received. A body that is not JSON is always shown raw.
  • A body that is not valid UTF-8, such as an image, is shown as <N bytes, not valid UTF-8>. There is no hex or image viewer.
  • The copy button copies the whole body to the clipboard.
  • The search button, or Ctrl F (⌘ F on macOS) in the body, opens a find bar inside the body, to jump between matches in long responses. It can match case, whole words or a regular expression, and search only in the selected lines (see Keyboard shortcuts). The counter in the field says which match is selected; with no match, or a regular expression that is not valid, the field turns red, and a note under it says what is wrong with the expression and where.
  • A thin line separates the line numbers from the text, and a vertical guide marks each indentation level, so the fields of a nested object line up at a glance. The guide of the block the cursor is in is brighter.
  • Point at the line numbers to see a chevron next to each JSON object or array: click it to fold the block into one line, and again to unfold it. In the Pretty view, Fold all in the right-click menu folds every object and array of the first level, so only the top level keys stay on screen, and Unfold all shows everything again.
  • Long lines wrap onto several lines, in both views. The Wrap button next to the copy button, Alt Z in the body, or Wrap lines in the right-click menu turns wrapping off, so long lines stay on one line and scroll sideways, and again turns it back on. The button is highlighted and the menu entry shows a check mark while the lines wrap. The choice applies to every response until Postino closes.
  • Right click the body for Copy, Select all, Fold all and Unfold all (Pretty view only) and Wrap lines.

The body is read only. Responses are kept in memory for the open tab and are not saved to disk.

Headers

Every response header, in the order received, with their count in the tab label. Each one is a row of a table, the name on the left and the value on the right; long values, such as cookies, tokens or a content security policy, wrap onto several lines instead of being cut. A header the server sent more than once, such as Set-Cookie, gets one row per value.

Header names are shown in lowercase, as the HTTP library receives them, whatever case the server used. When you read them from a script, res.headers.get() ignores case.

The Copy all headers button, at the right of the table's title row, copies every header to the clipboard, one name: value line per header, ready to paste into a message or a bug report.

Names and values are also selectable text. Drag over a cell to select part of it, double click to select a word, or drag across several cells, then press Ctrl C (⌘ C on macOS) to copy the selection. Cells copied together come out in reading order, one cell per line: a row's name, then its value, then the next row.

Tests

The Tests tab lists every test() of the post-response script, in order, each with a pass or fail mark and, for a failure, the error message. The tab label shows passed/total, green when all passed and red otherwise. The header summarizes the result, for example 3 of 4 tests passed.

A failing test does not stop the script: the remaining tests still run. See writing tests.

Console

The Console tab lists everything that happened during the last send, in order. The tab label shows the number of errors, in red, when there are any.

  • Script lines. One row per console.log(), console.info(), console.warn() or console.error() call, with its time (hours, minutes, seconds and milliseconds, in local time), the script it came from (pre-request or post-response), the text and the script line that logged it, such as post-response.js:4. Objects are printed as JSON. Warnings are amber, errors red.
  • The network entry. The request as it was sent: time, method, URL, then the status, time and size of the response. Click it to open its detail. Nothing in it is masked: the headers show their real values, the Authorization header and its token included, so the console shows exactly what went out.
  • The OAuth token. For a request that uses an OAuth 2.0 profile, before everything else: one network entry per token request, with its grant_type after the URL and its secrets masked, and oauth rows that tell what happened, such as token expired 12 min ago, refreshing it in amber and new token, expires at 11:42 (60 min) in green. A token that could not be obtained is a red row and counts as an error. Only one network entry is open at a time.
  • Errors. When a script throws, hits its time or memory limit, or the request cannot be sent, a red row with the error message, and the script line when it is known.

The detail of the network entry has two views:

  • Tree shows the request (method, URL, headers, body), the response (status, status text, headers, body), the timings (the total time, in milliseconds) and the environment the request ran with. Only the first level shows at first; click a row to open it, or use Expand all and Collapse. A JSON body becomes part of the tree, keeping the order of its keys; any other text body is one string. Strings show as JSON literals on a single row, so line breaks and tabs appear as \n and \t, and only their first 500 characters are shown. Copy copies the whole tree as JSON.

    To copy a single value, click its row to select it and press Ctrl C (⌘ C on macOS). A string is copied as its whole text, without quotes and with its line breaks; a number, true, false or null as written; a branch, such as headers, as JSON. Right click a row for a menu with Copy value, Copy key (such as x-sample-profile) and Copy path (such as response.headers.x-sample-profile). Once a row is selected, the arrow keys move through the tree (see Keyboard shortcuts). Closing a branch over the selected row selects the branch, and a new response clears the selection.

  • Raw shows the request and the response as HTTP/1.1 text: the request line, Host, the headers and the body, then the status line, the headers and the body. Headers the HTTP client adds by itself, such as User-Agent, are not listed. Copy copies both.

Bodies larger than 128 KB are left to the Body tab: the tree shows their size, and the raw text shows their first 128 KB.

The bar above the list filters it: All, Network, Logs (script lines and oauth rows) or Errors (script errors plus console.error() lines, with their count), and Filter console keeps the rows whose text or URL contains what you type, ignoring case. Clear empties the list until the next send.

console.log("received", res.size, "bytes in", res.timeMs, "ms");
console.warn("rate limit left:", res.headers.get("X-RateLimit-Remaining"));
console.log({ id: res.json().id, status: res.status });

Warnings

Problems that did not stop the request appear in a strip above the body.

Unknown variable
A {{name}} marker had no value in any variable layer, so it was sent literally as {{name}}. Several unknown variables are grouped in one line. Click Define to create the variable in an environment. See defining a variable.
Template function error
A {{ function() }} call had an unknown name, the wrong number of arguments or a bad argument. The marker was sent as written and the message explains why. See template function errors.
Invalid TLS certificate
The server's certificate is self-signed, expired or for another host, and the invalid certificates setting is Send with warning. The request was sent without verifying the certificate and the warning says what was wrong with it.
Outdated TLS
The server only offers outdated encryption, such as TLS 1.2 with RSA key exchange and CBC cipher suites (AES128-SHA), or TLS 1.0 and 1.1. Postino sent the request with the operating system's TLS library, which still supports it, verifying the certificate as usual. See outdated TLS.

Errors

When a run fails, the response pane says at which step:

MessageWhat happenedWhat is shown
Pre-request script failedThe pre-request script threw an error or ran out of time or memoryThe error. Nothing was sent.
Sending failedNo response at all: invalid URL, DNS error, connection refused, timeout, too many redirects, rejected certificateThe error.
Post-response script failedThe post-response script threw outside a test()The error, plus the response and every test and console line that ran before the error.
Couldn't get a tokenThe OAuth 2.0 token of the request's profile could not be obtained, or the sign-in was cancelledA card with the reason and what to do. Nothing was sent.
Response larger than the limitThe body is bigger than the maximum sizeThe limit. Raise it in Settings, Requests, Responses.

An HTTP error status, such as 404 or 500, is not a failure: it is a normal response with its body, headers and tests.

Large responses

Postino reads bodies up to the configured limit, 20 MB by default. Showing a big body costs memory: a 15 MB JSON response uses roughly 30 times its size while it is displayed, because of the editor and its highlighting. If you work with very large payloads, raise the limit only as much as you need.

Found a mistake? Edit this page on GitHub or open an issue.

↑↓to move ↵to open /or Ctrl Kto search from any page