Postman : Error: Parse Error: Invalid header value char

Viewed 30622

everyone. I'm trying to use postman for hitting our prod api, but I get some error:

enter image description here

enter image description here

I did not have that problem two days ago, and I have no idea what is happening. Anyone can advise ?

5 Answers

Turning on the "Send no-cache Header" option resolved this for me:

Screenshot

It's probably related to response header. Try this request in your browser and if it works, look at the response headers in devtools/network to find an invalid character.

In my case request wasn't working in Postman for one specific id. When I looked into response in devtools, I found that there was a double quote inside a double-quoted string header value and I think it caused this error, but I may well be wrong here.

Anyway, try this exact GET request in browser and see if it works there.

I had this problem when I was setting headers in golang using http like this:

w.Header().Set("‫‪X-Frame-Options‬‬", "‫‪Deny‬‬")

It worked fine in curl but not in postman and I didn't understand what was wrong. I also checked my headers using -v option in curl. Everything was correct. So I substitute Postman with Insomnia and it's working with no problem.

When you give HttpStatusCode as NoContent, this issue comes up. If you change the HttpStatusCode, it will work.

Related