How to make post request with params and body in Postman

前端 未结 1 1169
旧巷少年郎
旧巷少年郎 2021-02-07 11:45

I have endpoint which takes few parameters and body as input, and I want to test it in Postman. But, when I input data into \'form-data\' section in Postman backend throws error

1条回答
  •  抹茶落季
    2021-02-07 12:25

    For the request params you would add them to the end of the URL rather than in the request body, like you have done in the image. ?to=random@email.com&subject=Testing mailing feature&isMultipart=false&isHTML=true

    This can be seen in the Postman UI when you select the Params button, this can be found next to the Send button.

    I'm unsure about the string that you need in the request body and in what format the endpoint requires this data.

    If it's in a JSON format you could add {"content": "Some new content"} to the raw body and select JSON (application/json) from the dropdown, this will also set the correct request header.

    Edit:

    The UI has changed slightly since this answer was given. The Paramstab is now placed in a less confusing place.

    0 讨论(0)
提交回复
热议问题