SOAP Request returns unsupported media type. I already set the Body to raw, (text/xml).
Hey @rensonpd,
By selecting XML
from the drop down, in the request body - Youâre actually setting the header as application/xml
rather than text/xml
.
Did you change this manually after you created the request body to flip it to the correct header?
After selecting XML to the dropdown from Raw. header was automatically set to application/xml
You mentioned that you thought it was set to text/xml
.
Nope, I mean the XML in the dropdown is text/xml right? so after selecting the XML(text/xml), content-type is automatically set to application/xml. After trying a post request, unsupported media file type error is returned. This was working a while ago. this happened after updating the Postman to new version.
That drop down used to contain other options and would auto populate the header.
The XML setting will auto set the header to application/xml
, the way to check what is being set is by checking the Headers tab.
To ensure the correct Headers are being sent with your request, I would check that tab before sending.
I believe that there is an open issue around setting the header automatically but I would need to check up on that.
Yes, thatâs what currently happens/gets automatically set, when you use the XML
option from the request body.
You mentioned at the beginning that you thought that you were setting the text/xml
headerâŚthis is not the case, as you can clearly see.
You would need to manually change the value of the header in front of you to text/xml
by clicking on the text area that contains the application/xml
value. Once this has been changed, send the request again.
Does the same 415 code get returned?
I get it now. It now returns success 200. Thanks a lot Danny
This was a change in 7.6
Previously I had choice of XML:
- application/xml (Only 7.6 option)
- text/xml
Is there a way to override headers at a global or collection level?
I chose âXMLâ from the raw body type. That made the content-type header âapplication/xmlâ
on the header tab.
Once there, application/xml cannot be edited to text/xml.
What happens is that you can delete âapplicationâ and try to type âtextâ in its place, but it doesnât respond and changes it back to âapplicationâ
I am running it on a mac. postman version is 7.27.1
I presume that this isnât fixed as itâs also an issue for me (v7.28.0 Windows)
I can see the XML selection for the raw type in the body tab is setting the Content-Type header to application/xml but I canât find a way to change it to text/xml
If anyone can help Iâd be very grateful
Add your own âContent-Typeâ header to the bottom of the list of Headers. The one you add will override the one that was automatically generated.
This was the solution thanks friend