Viewing Responses
Understand and analyze API responses with syntax highlighting, formatting, media viewers, and test results.
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.
| Element | Description |
|---|---|
| Status Code | HTTP status code with human-readable text (e.g., "200 OK", "404 Not Found") |
| Response Time | How long the request took (shown as "245ms" or "1.5s" for longer requests) |
| Body Size | Size of the response body (dynamically formatted as bytes, KB, or MB) |
Status Code Colors
Status codes are color-coded for quick recognition:
| Range | Color | Meaning |
|---|---|---|
| 2xx | Green | Success |
| 3xx | Blue | Redirect |
| 4xx | Orange | Client Error (bad request, not found, etc.) |
| 5xx | Purple | Server Error |
Response Tabs
The response panel has four tabs. The Cookies and Scripts tabs only appear when relevant content exists.
| Tab | Shows | When Visible |
|---|---|---|
| Body | Response body with syntax highlighting | Always |
| Headers | Response headers with count badge (e.g., "Headers (15)") | Always |
| Cookies | Cookies set by the response | When cookies are present |
| Scripts | Test results and console output | When 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
| Header | What It Tells You |
|---|---|
Content-Type | Format of the response body (JSON, XML, HTML, etc.) |
Content-Length | Size of the response in bytes |
Cache-Control | Caching instructions |
ETag | Version identifier for caching |
Set-Cookie | Cookies sent by the server |
Location | Redirect target (for 3xx responses) |
Server | Server 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:
| Element | Description |
|---|---|
| Test Name | The assertion description |
| Status | Pass (green checkmark) or Fail (red X) |
| Duration | How long the test took (in milliseconds) |
| Error Message | Why 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)
| Code | Description |
|---|---|
| 200 | OK — request succeeded, body contains data |
| 201 | Created — resource created successfully |
| 204 | No Content — success, but no data to return |
Redirect Codes (3xx)
| Code | Description |
|---|---|
| 301 | Moved Permanently — resource moved to new URL |
| 302 | Found — temporary redirect |
| 304 | Not Modified — cached version is still valid |
Client Error Codes (4xx)
| Code | Description |
|---|---|
| 400 | Bad Request — request is malformed or invalid |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — authenticated but not allowed |
| 404 | Not Found — resource doesn't exist |
| 429 | Too Many Requests — rate limit exceeded |
Server Error Codes (5xx)
| Code | Description |
|---|---|
| 500 | Internal Server Error — server-side error occurred |
| 502 | Bad Gateway — upstream server error |
| 503 | Service Unavailable — server temporarily down |
| 504 | Gateway 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:
| Time | Rating | Color |
|---|---|---|
| Under 200ms | Excellent | Green |
| 200–500ms | Good | Orange |
| 500ms–1s | Acceptable | Orange |
| Over 1s | Slow (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
- Check Status Code First — Green means success, orange or purple means investigate
- Use the Scripts Tab — Add assertions to catch issues automatically
- Search Large Responses — Use
Cmd+Fto find specific data quickly - Use JSON Navigator — Browse complex nested responses with the tree sidebar
- Save Important Responses — Save responses for documentation or comparison
- Monitor Response Time — Watch for performance degradation over time
- Review Headers — Headers contain important metadata and caching info