Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use postman to test formdata?

Tags:

How can I use postman plugin of Google Chrome to send a FormData() object to a webapi using POST. The FormData() object has form fields personID and messageBody appended to it. I tried something like this but to no avail:

URL of the webapi: http://localhost/<<appName>>/api/v1/message  Headers: Accept:application/json Content-Type:multipart/form-data; boundary=---XXX---  form-data: personID:1 (Text)    messageBody:Hello (Text) 
like image 851
rkshakya99 Avatar asked May 21 '14 10:05

rkshakya99


People also ask

What is Formdata in Postman?

Form data allows you to send key-value pairs, and specify the content type. You can attach files using form data. When you repeatedly make API calls that send the same files, Postman will persist your file paths for subsequent use. This also helps you run collections that contain requests requiring file upload.

How do you test using Postman?

You can add tests to individual requests, collections, and folders in a collection. Postman includes code snippets you add and then modify to suit your test logic. To add tests to a request, open the request and enter your code in the Tests tab. Tests will execute after the request runs.


1 Answers

Postman has a form-data POST body option that automatically does this for you.

like image 176
Abhinav Avatar answered Oct 04 '22 02:10

Abhinav