63

I want POST an XML request to a webservice using Postman. However, when I check the available request formats, I only see options for form-data, x-www-form-urlencoded, raw, and binary.

How do I POST an XML request to a webservice with Postman?

1 Answer 1

140

Send XML requests with the raw data type, then set the Content-Type to text/xml.


  1. After creating a request, use the dropdown to change the request type to POST.

    Set request type to POST

  2. Open the Body tab and check the data type for raw.

    Setting data type to raw

  3. Open the Content-Type selection box that appears to the right and select either XML (application/xml) or XML (text/xml)

    Selecting content-type text/xml

  4. Enter your raw XML data into the input field below

    Example of XML request in Postman

  5. Click Send to submit your XML Request to the specified server.

    Clicking the Send button

5
  • 4
    alas, it's gone! It seems only available on chrome as extension. Feb 5, 2020 at 8:21
  • 1
    @snr Postman is still available as a desktop application.
    – Stevoisiak
    Aug 10, 2020 at 17:07
  • @Stevoisiak can you please give me a suggestions how to read this xml file into PHP, I have no idea how to read body xml data in to the php.
    – Dhruv
    Aug 13, 2020 at 17:12
  • 8
    @snr, in the Postman desktop app, you select Body>raw>XML, which, by default, gives you a Content-Type=application/xml header, then you deselect that default header and add a custom Content-Type=text/xml. I can't imagine a more convoluted way of doing it.
    – martinp999
    Oct 23, 2020 at 4:28
  • be careful with newlines when adding the xml body in Postman desktop app. Because of the new lines my request was failling
    – Teshte
    Mar 3 at 12:58

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.