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?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225

1 Answers1

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

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
  • 4
    alas, it's gone! It seems only available on chrome as extension. – Soner from The Ottoman Empire Feb 05 '20 at 08:21
  • 1
    @snr Postman is still available as [a desktop application](https://www.postman.com/). – Stevoisiak Aug 10 '20 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 '20 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 '20 at 04: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 03 '23 at 12:58