Copy and save
Right-click a request in the list.
| Menu item | Copies or saves |
|---|---|
| Copy ID | The request’s ID, such as 412.2: its connection, then its stream. Give it to your AI agent to point at this request. |
| Copy URL | The full URL. Also in the inspector’s right-click menu. |
| Copy as code › a language | Code that sends the request. See below. |
| Copy request body › Text, Base64, Hex | The request body |
| Copy response body › Text, Base64, Hex | The response body |
| Save request body… | The request body, to a file |
| Save response body… | The response body, to a file |
| Export… | The selected requests, as a recording. See Recordings. |
In the inspector, right-click a header, query parameter or cookie to copy it as name: value, or copy only its value.
Copy as code
Section titled “Copy as code”| Language | Written for |
|---|---|
| cURL | curl, in a POSIX shell such as bash or zsh |
| PowerShell | Invoke-WebRequest, PowerShell 7.4 and later |
| C# | HttpClient, as top-level statements |
| Go | net/http, as a program of its own |
| Java | java.net.http, Java 11 and later |
| JavaScript | fetch, where await is allowed at the top level |
| Kotlin | OkHttp 5 |
| Python | requests |
| Rust | reqwest on tokio |
| Swift | URLSession, as a script |
curl 'https://api.example.com/v2/cart/items' -X POST \ -H 'user-agent: ExampleApp/4.2 (iPhone; iOS 18.1)' \ -H 'content-type: application/json' \ -H 'accept-encoding: gzip, deflate, br' \ --compressed \ --data-raw '{"sku":"A-1001","quantity":1}'- Headers keep the app’s order and spelling.
- HTTP/2 pseudo-headers such as
:authorityare left out, and so isContent-Encoding: the body is given before encoding. Content-Lengthis left out; the client works it out.- curl keeps
Accept-Encodingand adds--compressedfor it. The other languages leave it out, so their library asks for what it can decode, and they also leave out the headers the library writes itself, such asHostandConnection. A header sent more than once is joined into one. - A binary request body can’t go in code. zhttp says so and copies nothing.
The command palette offers each language as Copy as cURL, Copy as Python and so on.
Bodies
Section titled “Bodies”Bodies are copied and saved with their Content-Encoding removed: a gzipped response is saved as the JSON or HTML it holds.
Only a whole body is copied. If a body is still arriving, or zhttp kept only part of it, nothing is copied and a message says why.
Save … body… suggests a file name from the URL and the content type.