Skip to content

Generate code

Courier turns a request into code you can paste into your project.

  • Click Code, next to cURL in the request editor.
  • Or choose Generate code… from the tab, sidebar or command palette menu.
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.

  • 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.