Generating client code

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


Generating code snippets in Postman

In Postman, select the request under your collection and click Code icon on the right panel to open the Code snippet tab.

User Menu

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

Code Language

Click the Gear icon to find additional configuration options based on your chosen language.

Code settings

Supported languages/frameworks

Postman currently supports the following options:

Language Framework
C LibCurl
C# RestSharp
Dart Dart
Go http package
HTTP (Raw HTTP request)
Java OkHttp
Java Unirest
JavaScript Fetch
JavaScript jQuery
JavaScript XHR
NodeJS Axios
NodeJS Native
NodeJS Request
NodeJS Unirest
Objective-C NSURLSession
OCaml Cohttp
PHP Http_Request2
PHP pecl_http
PowerShell RestMethod
Python http.client (Python 3)
Python Requests
Ruby NET::Http
Shell Httpie
Shell wget
Swift URLSession

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.