Generating code snippets

  • App

Once you’ve finalized and saved your request in Postman, you might want to make the same request from your own application. Postman lets you generate snippets of code in various languages and frameworks that will help you do this. You’ll need to click the Generate Code link under the blue Send button to access this feature.

Selecting a language

Use the dropdown menu to select a language. Some languages have multiple options - this lets you select different frameworks to make your request from.

Supported languages/frameworks

For now, Postman supports the following options:

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