RESTKDocs

Viewing Responses

Understand and analyze API responses with syntax highlighting, formatting, media viewers, and test results.

9 min read

After sending a request, RESTK displays the response in an easy-to-read format with status information, headers, body content, cookies, and test results.

Quick Start

Send Request

Click Send or press Cmd+Enter to execute your request.

View Status

See the HTTP status code, response time, and body size in the status bar.

Explore Tabs

Switch between Body, Headers, Cookies, and Scripts tabs to see different aspects of the response.

Copy or Search

Use copy buttons or Cmd+F to search within large responses.


Response Status Bar

At the top of the response panel, you'll see key information about the response.

ElementDescription
Status CodeHTTP status code with human-readable text (e.g., "200 OK", "404 Not Found")
Response TimeHow long the request took (shown as "245ms" or "1.5s" for longer requests)
Body SizeSize of the response body (dynamically formatted as bytes, KB, or MB)

Status Code Colors

Status codes are color-coded for quick recognition:

RangeColorMeaning
2xxGreenSuccess
3xxBlueRedirect
4xxOrangeClient Error (bad request, not found, etc.)
5xxPurpleServer Error

Response Tabs

The response panel has four tabs. The Cookies and Scripts tabs only appear when relevant content exists.

TabShowsWhen Visible
BodyResponse body with syntax highlightingAlways
HeadersResponse headers with count badge (e.g., "Headers (15)")Always
CookiesCookies set by the responseWhen cookies are present
ScriptsTest results and console outputWhen tests or console output exist

Body Tab

The Body tab shows the response content from the server with rich viewing capabilities.

Syntax Highlighting

Responses are automatically formatted with syntax highlighting for five languages, detected from the Content-Type header or body inspection:

  • JSON — keys, strings, numbers, booleans, null values
  • XML — tags, attributes, values
  • HTML — tags, attributes, content
  • CSS — selectors, properties, values
  • JavaScript — keywords, strings, functions

Pretty Print

JSON, HTML, and CSS responses are automatically indented for readability.

Before formatting:

{"id":12345,"name":"John Doe","email":"[email protected]"}

After formatting:

{
  "id": 12345,
  "name": "John Doe",
  "email": "[email protected]"
}

Automatic Formatting

Formatting happens automatically based on the Content-Type header. No manual action needed.

JSON Navigator

For JSON responses, an optional sidebar provides path navigation — browse the JSON structure as a tree and click any node to jump to its location in the body. Useful for exploring deeply nested responses.

HTML Preview

When the response is HTML, you can toggle a live preview that renders the HTML in a web view. This is helpful for inspecting HTML responses from web APIs or server-rendered pages.

Media Viewers

RESTK includes dedicated viewers for media responses, automatically detected via content type and magic number analysis (inspecting the first bytes of the response):

  • Images — Inline preview for JPEG, PNG, GIF, WebP, SVG, and more
  • Video — Playback for MP4, WebM, and other video formats
  • Audio — Playback for MP3, WAV, and other audio formats
  • PDF — Inline PDF viewer

Search Within Body

For large responses, press Cmd+F to search within the body. Type your search term and use arrows or Enter to jump between matches.

Copy Response Body

Click the Copy button at the top of the body section to copy the entire response to your clipboard.


Headers Tab

The Headers tab displays all HTTP headers returned by the server, sorted alphabetically.

Header Display

Headers are shown as key-value pairs in a clean layout:

Cache-Control: no-cache
Content-Length: 1234
Content-Type: application/json
ETag: "abc123"
Set-Cookie: session=xyz789; Path=/; HttpOnly

Common Response Headers

HeaderWhat It Tells You
Content-TypeFormat of the response body (JSON, XML, HTML, etc.)
Content-LengthSize of the response in bytes
Cache-ControlCaching instructions
ETagVersion identifier for caching
Set-CookieCookies sent by the server
LocationRedirect target (for 3xx responses)
ServerServer software information

Copy Individual Headers

Hover over any header to reveal a copy button. Click to copy in Key: Value format — a checkmark confirms the copy.


Cookies Tab

When the response includes Set-Cookie headers, the Cookies tab appears showing each cookie with its properties — name, value, domain, path, expiry, and flags (HttpOnly, Secure, SameSite).


Scripts Tab

If your request includes tests or produces console output, the Scripts tab appears combining both in one view.

Test Summary

At the top, you'll see:

  • Total Passed: Number of assertions that succeeded (green checkmark)
  • Total Failed: Number of assertions that failed (red X)
  • Pass Rate: Percentage of tests passed

Individual Test Results

Each test shows:

ElementDescription
Test NameThe assertion description
StatusPass (green checkmark) or Fail (red X)
DurationHow long the test took (in milliseconds)
Error MessageWhy the test failed (if applicable)

Console Output

Any console.log(), console.warn(), or console.error() output from your scripts appears below the test results.

Writing Tests

Tests are written in post-response scripts using assertions. Learn more in the Scripting documentation.


Special Response Types

Empty Responses

Some requests return no body (e.g., 204 No Content).

What you'll see:

  • Status: 204 No Content
  • Body tab shows an empty state message
  • Headers still visible

Binary Responses

For non-text responses (images, PDFs, files), RESTK automatically detects the content type using magic number analysis and shows the appropriate viewer:

  • Images: Rendered inline with zoom and pan
  • Video/Audio: Playback controls
  • PDF: Inline document viewer
  • Other binary: File size displayed with a Download button

Large Responses

Responses over 50 MB are saved to disk instead of displayed inline.

What you'll see:

  • A notice that the response was saved to a file
  • Option to open or save the full response
  • Response metadata (status, time, size) still visible in the status bar

Response Actions

Copy Response

Copy Body: Copies the entire response body to clipboard

Copy Headers: Copies all headers as text

Save Response

Click Save Response to save the body to a file on your device. RESTK suggests a filename from the Content-Disposition header or URL, and auto-detects the file extension from the content type.

Supported formats include:

  • JSON → .json
  • XML → .xml
  • HTML → .html
  • Text → .txt
  • Images → .png, .jpg, .gif, etc.
  • PDF → .pdf
  • Archives → .zip, .tar, .gz
  • And many more

Understanding Status Codes

Success Codes (2xx)

CodeDescription
200OK — request succeeded, body contains data
201Created — resource created successfully
204No Content — success, but no data to return

Redirect Codes (3xx)

CodeDescription
301Moved Permanently — resource moved to new URL
302Found — temporary redirect
304Not Modified — cached version is still valid

Client Error Codes (4xx)

CodeDescription
400Bad Request — request is malformed or invalid
401Unauthorized — authentication required
403Forbidden — authenticated but not allowed
404Not Found — resource doesn't exist
429Too Many Requests — rate limit exceeded

Server Error Codes (5xx)

CodeDescription
500Internal Server Error — server-side error occurred
502Bad Gateway — upstream server error
503Service Unavailable — server temporarily down
504Gateway Timeout — upstream server didn't respond

5xx Errors Are Server Issues

5xx errors indicate problems on the server side, not with your request. Contact the API provider if these persist.


Performance Analysis

Response Time

Response time indicates how long the request took. Color-coded for quick assessment:

TimeRatingColor
Under 200msExcellentGreen
200–500msGoodOrange
500ms–1sAcceptableOrange
Over 1sSlow (investigate)Red

Factors affecting response time:

  • Network latency
  • Server processing time
  • Response size
  • Database queries on server side

Body Size

Large responses take longer to transfer and process.

Size considerations:

  • Under 100KB: Small, fast
  • 100KB–1MB: Medium
  • Over 1MB: Large, consider pagination

Troubleshooting

Invalid JSON Error

Cause: Server returned malformed JSON

Solution:

  • Check the Body tab (shown as raw text)
  • Look for syntax errors (missing quotes, commas)
  • Contact API provider if server is sending bad JSON

Empty Response

Cause: Server returned no body

Check:

  • Status code (204 is expected for empty responses)
  • Request method (DELETE often returns no body)
  • API documentation to see if response is expected

Timeout Error

Cause: Request took too long (over 30 seconds by default)

Solutions:

  • Check your internet connection
  • Try again (server may be slow or overloaded)
  • Increase timeout in request Settings tab or global settings

Best Practices

  1. Check Status Code First — Green means success, orange or purple means investigate
  2. Use the Scripts Tab — Add assertions to catch issues automatically
  3. Search Large Responses — Use Cmd+F to find specific data quickly
  4. Use JSON Navigator — Browse complex nested responses with the tree sidebar
  5. Save Important Responses — Save responses for documentation or comparison
  6. Monitor Response Time — Watch for performance degradation over time
  7. Review Headers — Headers contain important metadata and caching info

Next Steps