Generate code
Courier turns a request into code you can paste into your project.
Open the code view
Section titled “Open the code view”- Click Code, next to cURL in the request editor.
- Or choose Generate code… from the tab, sidebar or command palette menu.
Languages
Section titled “Languages”| Language | Library |
|---|---|
| Shell | cURL, HTTPie |
| JavaScript | fetch |
| Node.js | axios, http |
| Python | requests |
| Go | net/http |
| Java | HttpClient |
| Kotlin | OkHttp |
| C# | HttpClient |
| Ruby | Net::HTTP |
| Rust | reqwest |
| Swift | URLSession |
| PowerShell | Invoke-WebRequest |
| PHP | cURL |
For gRPC requests, Courier exports a grpcurl command.
Options
Section titled “Options”- Variables: filled in by default, or kept as
{{name}}. - Show secrets: secret values stay masked unless you tick this.
- Headers: include all headers, or only the non-default ones.
JSON, form and multipart bodies use each library’s own way of sending them. Redirects and the timeout follow your Settings. Courier remembers the last language you picked.
Click Copy to copy the snippet.