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)
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.
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.
Postman has a form-data POST body option that automatically does this for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With