Dear community,
I hope someone can help me. When I send curl -H “Accept: application/xml” localhost:8080/movie to my server. I get the answer in xml format. But when I tray to do it in postman, is it not working. In Postman I did a Get request http://localhost:8080/movie and I added under headers a key ( Content-Type) value (application/xml), with the name Content-Type-xml. When I look under Headers I can see that my Content-Type-xml ist checked. When I send my request, my result is only in json not in xml. My server send json in default. I make only this changes. Can someone tell me, what I’m doing wrong?
Hey @tommy78
Welcome to the Postman Community
Can you provide some visual examples of how you have structured your request, with the headers section showing please?
Do you also add in the correct Accept header into Postman?
Are you also able to manually add in that Accept
header to mimic what you have in the curl command?
What part of your server code returns the XML or JSON?
Hallo Danny,
thank you very much! You helped me to understand how the headers are working. You are right, I didn’t use the Accept header and this was the problem. Postman is a great tool
You’re welcome. Happy to help.
Top tip - you can paste your curl command directly into the URL address bar in the app and it will create the request for you. That should help with any missing details.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.