Skip to main content
Requestly can convert any configured API request into a ready-to-paste code snippet. Use this to move from manual testing to implementation without rewriting the request from scratch.

How to Generate Client Code

1

Open API Request

Navigate to the API request for which you want to generate code.
2

Access Code Generation Menu

Click the three dots next to the Save button, then select Copy As from the dropdown.
3

Choose a Programming Language

A modal opens with the generated code. Use the dropdown at the top left to switch languages.
4

Copy the Code

Click Copy in the top right corner to copy the snippet to your clipboard.

Example Output

For a POST https://api.example.com/users request with a JSON body and a Bearer token, here is what the generated code looks like per language:
curl --request POST \
  --url https://api.example.com/users \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Jane Doe","email":"jane@example.com"}'

Supported Languages

LanguageLibrary / Variant
Clibcurl
C#HttpClient, RestSharp
Clojureclj-http
GoNative
HTTPRaw HTTP message
JavaAsyncHttp, NetHttp, OkHttp, Unirest
JavaScriptAxios, Fetch, jQuery, XHR
KotlinOkHttp
Node.jsAxios, Fetch, HTTP, Request, Unirest
Objective-CNSURLSession
OCamlCoHTTP
PHPcURL, Guzzle, HTTP v1, HTTP v2
PowerShellInvoke-WebRequest, Invoke-RestMethod
PythonRequests
Rhttr
Rubynet::http
ShellcURL, HTTPie, Wget
SwiftURLSession