Send parameters and body data with API requests in Postman | Postman Learning Center (2024)

The Postman API client enables you to send data along with your HTTP requests. You can add query and path parameters to a request and specify their values. You can also add body data to a request in various formats, including form data, URL-encoded, raw, and binary.

Send request parameters

You can specify path and query parameters for a request using the URL box or the Params tab.

  • Query parameters are appended to the end of the request URL, following ? and listed in key-value pairs, separated by & as follows: ?id=1&type=new
  • Path parameters form part of the request URL, and are referenced using placeholders preceded by : as in the following example: /customer/:id

To specify a query parameter, add it directly to the URL or select the Params tab and enter the name and value. When you enter your query parameters in either the URL or the Params tab, these values will update everywhere they're used in Postman.

Parameters aren't automatically URL-encoded. Right-click selected text, and choose EncodeURIComponent to manually encode a parameter value.

To specify a path parameter, enter the parameter name into the URL box, after a colon, for example :id. When you enter a path parameter, Postman will populate it in the Params tab, where you can also edit it.

You can add descriptions to your parameters and they'll appear for anyone sharing the request (for example in your workspace) or viewing your API documentation.

When you're done entering parameters, select Send to send the request. Learn more about creating and sending requests in Postman.

Send parameters and body data with API requests in Postman | Postman Learning Center (1)

You can use the Bulk Edit option if you prefer to enter your parameters in plain text instead of using the request builder.

Send body data with requests

You need to send body data with requests whenever you want to add or update structured data. For example, if you're sending a request to add a new customer to a database, you might include the customer details in JSON. Typically you use body data with PUT, POST, and PATCH requests.

The Body tab enables you to specify the data you need to send with a request. You can send different types of body data to suit your API.

If you're sending body data, make sure you have the correct headers selected to indicate the content type your API may need to process the received data.

  • For form-data and urlencoded body types, Postman will automatically attach the correct Content-Type header.
  • If you use raw mode for your body data, Postman will set a header based on the type you select (such as text or json).
  • If you manually select a Content-Type header, that value will take precedence over what Postman sets.
  • Postman doesn't set any header type for the binary body type.

By default, Postman will select None for body data. Leave it selected if you don't need to send a body with your request. Otherwise, choose the data type you need for your request body: form data, URL-encoded, raw, binary, or GraphQL.

When you're done entering body data, select Send to send the request. Learn more about creating and sending requests in Postman.

Form data

Website forms often send data to APIs as multipart/form-data. You can replicate this in Postman using the form-data option in the Body tab of your request. Form data enables you to send key-value pairs and specify the content type.

You can also attach a file using form data and send it with your request. Select File in the dropdown list next to a key name, then select the file you want to send. You can select a file from your local system, and Postman saves the file path in the request. The saved file path is relative to your local working directory.

You can also upload a file with test data to your Postman team. This is useful if you want to share the request with others on your team or use the request in a monitor or scheduled collection run. Learn more about uploading files for shared requests and cloud runs.

Send parameters and body data with API requests in Postman | Postman Learning Center (2)

URL-encoded

URL-encoded data uses the same encoding as URL parameters. If your API requires url-encoded data, select x-www-form-urlencoded in the Body tab of your request. Enter your key-value pairs to send with the request and Postman will encode them before sending.

There is sometimes confusion between form data and URL-encoded. If you are unsure which one you need, check with your API provider.

Raw data

You can use raw body data to send anything you can enter as text. In the Body tab of your request, select the raw option and use the dropdown list to indicate the format of your data (Text, JavaScript, JSON, HTML, or XML). Postman will enable syntax-highlighting and appending the relevant headers to your request.

Send parameters and body data with API requests in Postman | Postman Learning Center (3)

You can set a content type header manually if you need to override the one Postman sends automatically.

You can use variables in your body data and Postman will populate their current values when sending your request.

For JSON raw body data, you can add comments, and they will be stripped out when the request is sent. Single-line comments delimited with // and multi-line comments delimited with /* */ will be removed in the request.

To beautify your XML or JSON, select the text in the editor and then select ⌘+Option+B or Ctrl+Alt+B.

Binary data

You can use binary data to send information you can't enter manually in the Postman editor with your request body, such as image, audio, and video files. (You can also send text files.)

In the Body tab of your request, select the binary option, then select the file you want to send with the request. You can select a file from your local system, and Postman saves the file path in the request. The saved file path is relative to your local working directory.

You can also upload a file with test data to your Postman team. This is useful if you want to share the request with others on your team or use the request in a monitor or scheduled collection run. Learn more about uploading files for shared requests and cloud runs.

Send parameters and body data with API requests in Postman | Postman Learning Center (4)

GraphQL

You can send GraphQL queries with your Postman requests by selecting the GraphQL option in the Body tab of your request. Enter your code in the Query pane and any variables in the GraphQL Variables pane.

Check out GraphQL in Postman for more information on GraphQL, including how to enable Autocomplete powered by Postman API schemas.

Send parameters and body data with API requests in Postman | Postman Learning Center (2024)
Top Articles
Simulacrum
Sole Proprietorship vs Corporation: How To Choose | Ownr Blog
Food King El Paso Ads
Main Moon Ilion Menu
Inducement Small Bribe
Ffxiv Shelfeye Reaver
Chatiw.ib
Rabbits Foot Osrs
Samsung 9C8
Derpixon Kemono
Prices Way Too High Crossword Clue
Identogo Brunswick Ga
104 Whiley Road Lancaster Ohio
Billionaire Ken Griffin Doesn’t Like His Portrayal In GameStop Movie ‘Dumb Money,’ So He’s Throwing A Tantrum: Report
Mikayla Campinos Laek: The Rising Star Of Social Media
Myhr North Memorial
Isaidup
Doublelist Paducah Ky
Shreveport City Warrants Lookup
Weve Got You Surrounded Meme
Which Sentence is Punctuated Correctly?
Skycurve Replacement Mat
1636 Pokemon Fire Red U Squirrels Download
4.231 Rounded To The Nearest Hundred
United E Gift Card
Myra's Floral Princeton Wv
Abga Gestation Calculator
RFK Jr., in Glendale, says he's under investigation for 'collecting a whale specimen'
Steven Batash Md Pc Photos
What Are Digital Kitchens & How Can They Work for Foodservice
School Tool / School Tool Parent Portal
How Much Is Mink V3
Craigslist Lakeside Az
Page 5662 – Christianity Today
Überblick zum Barotrauma - Überblick zum Barotrauma - MSD Manual Profi-Ausgabe
Legit Ticket Sites - Seatgeek vs Stubhub [Fees, Customer Service, Security]
2 Pm Cdt
Fwpd Activity Log
Craigslist - Pets for Sale or Adoption in Hawley, PA
Traumasoft Butler
Sig Mlok Bayonet Mount
Exam With A Social Studies Section Crossword
Arnesons Webcam
Quaally.shop
Wgu Admissions Login
UWPD investigating sharing of 'sensitive' photos, video of Wisconsin volleyball team
Zeeks Pizza Calories
Sherwin Source Intranet
Displacer Cub – 5th Edition SRD
Bonecrusher Upgrade Rs3
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 6198

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.