Skip to content

Commit b152fd5

Browse files
committed
Add the Send page to the docs
1 parent a9ace3e commit b152fd5

File tree

7 files changed

+106
-3
lines changed

7 files changed

+106
-3
lines changed

src/docs/reference/amiusing.httptoolkit.tech.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: 'AmIUsing Test Site'
33
title: 'AmIUsing Test Site'
4-
order: 4
4+
order: 5
55
---
66

77
The [amiusing.httptoolkit.tech](https://amiusing.httptoolkit.tech) site is a built-in test site for HTTP Toolkit.

src/docs/reference/mock-page.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ order: 2
66

77
![The Mock page, showing mock rules](../../images/edit-screenshot.png)
88

9-
The Mock page allows you to rewrite traffic, to simulate fake servers, test edge cases, or change real HTTP requests and responses in any other way you'd like.
9+
The Mock page allows you to rewrite traffic, simulate fake servers, test edge cases, or change real HTTP requests and responses in any other way you'd like.
1010

1111
It shows a list of rules, which define how all HTTP traffic is handled. Each rule has a matcher and an action. The matcher defines which requests it applies to, and the action defines what happens to matching requests.
1212

1313
Every request is matched against each rule one by one from the top, until a matching rule is found, and the action for that rule is then run. Only one rule ever matches any request. If no rule matches, the request receives a 503 error, where the body explains the details of the request, and the details of the existing rules that didn't match.
1414

1515
Rule changes only take effect when saved. You can save all changes to rules from the button at the top, or save any one individual rule from the button on its row.
1616

17+
Mock rules defined here are only stored persistently with [HTTP Toolkit Pro](/get-pro/). For hobbyist users, the rules reset to their defaults every time HTTP Toolkit restarts.
18+
1719
## Page structure
1820

1921
The Mock page consists of a set of controls at the top, an 'Add a new rule' button, and a reorderable list of existing rule rows.
160 KB
Loading

src/docs/reference/send-page.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
name: 'The Send Page'
3+
title: 'The Send Page'
4+
order: 3
5+
---
6+
7+
![The Send page, showing a request to example.com](./send-page-screenshot.png)
8+
9+
From the Send page, you can send HTTP requests yourself directly, with HTTP Toolkit acting as a graphical HTTP client. You can also resend intercepted requests (with [HTTP Toolkit Pro](/get-pro/)) by selecting a request on the View page and clicking the Send icon in the bottom right, to recreate an intercepted request here ready to be sent manually.
10+
11+
When you send a request, HTTP Toolkit sends it directly to the server (not via HTTP Toolkit's proxy) so it's not affected by mock rules, and you'll see the real behaviour of the request.
12+
13+
Sent requests and their responses are also recorded in the traffic log, along with intercepted traffic, so you can see them on the View page like any other traffic. All requests are marked with the red Send icon, so they're clearly visible.
14+
15+
Similarly to mock rules, requests defined on the Send page are only stored persistently with [HTTP Toolkit Pro](/get-pro/). For hobbyist users, this pane resets every time the app restarts.
16+
17+
The Send page is split into three parts:
18+
19+
* A tab bar at the top, to create and switch between multiple requests
20+
* A request pane on the left, where you can enter the details of a request to send
21+
* A response pane on right right, showing the latest response for the request
22+
23+
## The tab bar
24+
25+
The tab bar at the top shows a tab for each request you've created, with a plus button on the right to create a new one. This controls both panes below, which show the corresponding request & response for the selected tab.
26+
27+
Each tab shows the request method (e.g. POST) and URL, or a 'New request' placeholder if no URL has been entered yet.
28+
29+
The selected request shows a cross icon to close it. You can also close requests by focusing the tab bar and pressing delete, or by middle-clicking any tab.
30+
31+
## The request pane
32+
33+
![The Send request pane, showing a request to example.com with a gzipped JSON body](./send-request-pane.png)
34+
35+
In the request pane on the left, you can define each part of the request you'd like to send. It's made up of a few parts:
36+
37+
* A top row, containing an HTTP method selector, a URL input, and a button to send the request
38+
* A request headers section
39+
* A request body section
40+
41+
Both the request headers & body can be collapsed by clicking their names, and you can also expand either (using the icon in the corner) to show only that pane at its maximum size.
42+
43+
### Request headers
44+
45+
The request headers section shows a series of key/value rows, for the headers that should be sent with the request.
46+
47+
To add a header, go to the last row (which will show a 'Header name' and 'Header value' placeholder) and start typing. To remove any row just click the delete icon at the end.
48+
49+
Some headers have special behaviour, such as:
50+
51+
* The `host` header. This is required in all modern HTTP requests. This value will be automatically populated & updated whenever the URL is edited, unless it has been manually modified to a different value.
52+
* The `content-length` and `transfer-encoding` headers. These are used to tell the server how long the body will be (sending an explicit length either in the header, or by encoding the body as a series of chunks with their own lengths). When you add a body, a `content-length` header will be automatically added & updated to match the body length, unless you manually modify the header or add your own `transfer-encoding: chunked` header.
53+
* The `content-encoding` header. This is used to define encodings (generally compression) that should be applied to a request body. If you set this header to a valid value (such as `gzip`) then the body will be automatically compressed to match when it's sent, and any `content-length` header will also be updated to match the compressed length.
54+
* The `content-type` header. This defines the format of the content (e.g. JSON, XML, Protobuf). If you set this to any recognized value, the request body section will update to show the body in the corresponding format. If you modify the format used by the request body section, this header will be updated automatically, unless it has been manually modified to a different value.
55+
56+
### Request body
57+
58+
The request body section shows an editor where you can enter the body of the request you'd like to send.
59+
60+
You can enter any text you'd like here, and you can select from various common formats in the dropdown to enable automatic syntax highlighting & validation.
61+
62+
For content types that can be automatically formatted (e.g. JSON and XML) you can click the format icon in the top right to tidily reformat & indent your input.
63+
64+
The top of this section also shows the total unencoded byte length of the request body. Note that this might differ from the final sent length of the body (as shown in the `content-length` header) if a `content-encoding` header is set so that compression such as gzip is applied.
65+
66+
## The response pane
67+
68+
![The Send response pane, showing an HTML response from example.com](./send-response-pane.png)
69+
70+
The response pane on the right shows the latest response data, after the request has been sent at least once (if not, it stays blank). It's made up of a few parts:
71+
72+
* A top status row, showing the essential response details
73+
* A response headers section
74+
* A response body section
75+
76+
Both the response headers & body can be collapsed by clicking their names, and you can also expand either (using the icon in the corner) to show only that pane at its maximum size.
77+
78+
### The response status row
79+
80+
This row shows, from left to right:
81+
82+
* The response HTTP status.
83+
* The total response time, measured between starting the initial connection and receiving the completed body.
84+
* The raw encoded size of the response body, if any.
85+
* A button to jump to this HTTP exchange on the View page, to show more detailed information.
86+
87+
### The response headers section
88+
89+
This section shows the headers as returned by the server, in the same format as the View page.
90+
91+
You can click the plus icon next to any recognized header for more information and links to the Mozilla Developer Network's docs for this header.
92+
93+
### The response body section
94+
95+
This section shows the body as returned by the server, in the same format as the View page. The body shown here is automatically decoded if any `content-encoding` header was provided, so that encodings like gzip compression are handled transparently.
96+
97+
At the top of this section, you can configure the formatting of this body in the dropdown. This setting will automatically reformat the body (e.g. tidily indenting JSON for readability) and enable features like syntax highlighting and folding for the specified format.
98+
99+
You can also see the size of the body here (this shows the full decoded size - see the size data in the top status row for the raw encoded size) and download the entire body as a file (requires [HTTP Toolkit Pro](/get-pro/)) for reference later or analysis elsewhere.
100+
101+
**Any questions? [Get in touch](/contact/)**
34.6 KB
Loading
69.6 KB
Loading

src/docs/reference/settings-page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: 'The Settings Page'
33
title: 'The Settings Page'
4-
order: 3
4+
order: 4
55
---
66

77
The Settings page is only available to [HTTP Toolkit Pro](/get-pro/) users. It allows you to configure extra proxy settings, UI themes, and manage your account.

0 commit comments

Comments
 (0)