Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I POST XML data to a webservice with Postman?

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?

like image 394
Stevoisiak Avatar asked Nov 14 '17 21:11

Stevoisiak


People also ask

How do I POST XML data in Web API?

To post XML data to the server, you need to make an HTTP POST request, include the XML in the body of the request message, and set the correct MIME type for the XML. The correct MIME type for XML is application/xml.

Does Postman support XML?

When you select an XML body type, Postman automatically adds a content type header of application/xml . But depending on your service provider, you may need text/xml for some SOAP requests.

How do I send XML data to a restful web service?

If you want to send XML data to the server, set the Request Header correctly to be read by the sever as XML. xmlhttp. setRequestHeader('Content-Type', 'text/xml'); Use the send() method to send the request, along with any XML data.


1 Answers

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

like image 197
Stevoisiak Avatar answered Oct 14 '22 08:10

Stevoisiak