Generating client code

You can generate code snippets in various languages and frameworks within Postman.


Generating code snippets in Postman

In Postman, select Code under Save to open Generate Code Snippets.

User Menu

Select a language to view and copy your generated code snippet.

Generate code snippets

Click Settings to find additional configuration options based on your chosen language.

Generate code settings

Supported languages/frameworks

Postman currently supports the following options:

Language Framework
C LibCurl
C# RestSharp
cURL None (Raw cURL command)
Go Built-in http package
HTTP None (Raw HTTP request)
Java OkHttp
Java Unirest
JavaScript Fetch
JavaScript jQuery AJAX
JavaScript Built-in XHR
NodeJS Axios
NodeJS Built-in http module
NodeJS Request
NodeJS Unirest
Objective-C Built-in NSURLSession
OCaml Cohttp
PHP Built-in curl
PHP HttpRequest
PHP pecl_http
PowerShell RestMethod
Python Built-in http.client (Python 3)
Python Requests
Ruby Built-in NET::Http
Shell HTTPie
Shell wget
Shell cURL
Swift Built-in NSURLSession

If your language isn't currently offered, or if there is a setting that you'd find useful, click Contribute on GitHub to contribute to Postman's open source project.

Next steps

Learn about Capturing HTTP requests and Interceptor.