thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.62k stars 127 forks source link

Collection headers do not appear to work #1437

Closed Shujee closed 8 months ago

Shujee commented 9 months ago

Question: So I have set Accept header to application/json in my collection settings, but my request still requires me to add this header at the request level. If I don't, the server thinks it is a non-API call (server is Laravel which uses this header to distinguish between API vs. standard web requests). The header is marked (with blue tick) in collecton settings and settings are saved.

Are you using the free version/paid version/trial: yes

rangav commented 8 months ago

Hi @Shujee

Remove accept header from request level, then it will use the collection level header

Shujee commented 8 months ago

Have been a few days since I faced this problem. The issue was that collection headers were not being inherited by the requests in that collection. So if I set Accept header to application/json at collection level, the requests in the collection would not use this header and I had to set it at request level too, which means I had to set it for every request in the collection.

I have not been able to reproduce the problem later, so maybe this was some mistake on my part. I'll update here if I face the issue again. Thanks for getting in touch.

rangav commented 8 months ago

disable accept header in the request level and it will work

test with this sample url - https://www.thunderclient.com/t/params

Screenshot 2024-01-16 at 14 54 09
Shujee commented 5 months ago

I'm still facing this problem with version 2.19.5, but I think I have figured out the real issue. I need to have the header at request level and uncheck it for the request to use collection level headers. If, instead of unchecking, I totally remove the header from the request, it will NOT use the collection header too.