issues with Content-Type : text/xml

ukerandi
ukerandi used Ask the Experts™
on
Hi Experts,

I have added Content-Type to application/json But it's returning Content-Type : text/xml; charset=UTF-8
How to get the Json type. I have tested in the Post man

when i'm calling from C# progarme it's working fine,But it's not working in the Post man API and sharepoint 365 flow
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Eduard GherguArchitect - Coder - Mentor

Commented:
Hi!

Where have you set Content-Type to application/json ?
Duy PhamFreelance IT Consultant

Commented:
How did your C# program call the web service (or API)? If it did also use HTTP Client, then maybe there is something happens on web service/API side. Try to log and compare request headers in both case C# program and Postman to see if there is any difference.

Also, it would be easier for everyone to help if you could give a bit more details about how web service/API is implemented.
ste5anSenior Developer

Commented:
Use Fiddler to compare your calls from your application as well as from Postman.

And again: You need to set the Accept header. I said Content-Type in my first answer but this was a slip as I meant from the beginning the Accept header.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Author

Commented:
@Eduard Ghergu

Header
Eduard GherguArchitect - Coder - Mentor

Commented:
Hi,
Yes, I was not very explicit with the question. I mean, you have set it on the back-end or on the frontend? What is the context of your question?

Author

Commented:
Front end

Author

Commented:
it's working now at Postman API not work flow.
Architect - Coder - Mentor
Commented:
If you receive the content formatted differently, you need to adjust the way that the backend will format the response to the client.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial