REST Client adds header to a request without a way to inspect what is added
See original GitHub issueI spent several hours today to diagnose an issue until I learned that REST client adds some headers to REST calls without providing any way to inspect what is added.
When a cookie or header is automatically added to a request, REST client needs to provide a way to let us know what exactly is added:
rest-client.rememberCookiesForSubsequentRequests
rest-client.defaultHeaders
After spending several hours, I used Wireshark and found that my requests are being changed by this extension, without any straightforward way for me to know what happened.
Postman does not do such a thing. The Console transparently shows the raw version of what has been sent to a server.
I suggest this matter be addressed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Understanding REST Headers and Parameters - SoapUI
The REST headers and parameters contain a wealth of information that can help you track down issues when you encounter them. HTTP Headers...
Read more >Add instruction 'how' to perform a REST API request by adding ...
Specify a custom header Confirmation: no-confirmation · Add a query param ?confirmation=false · Add a send_confirmation field to the request body.
Read more >Using the "Accept" Request Header in RESTful APIs - YouTube
In this video I'll be demonstrating the usage of the "Accept" request header in HTTP (and how it's used in RESTful APIs or...
Read more >22. What is header in API and how to pass them in Rest ...
Headers are metadata associated with the request and response of API. In this video, we are going to learn different ways of passing...
Read more >Using the REST Client - Quarkus
The MicroProfile REST client allows amending request headers by registering a ClientHeadersFactory with the @RegisterClientHeaders annotation. Let's see it in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Huachao , thanks for you work and this extension!
@asmith3006 , thanks for you recommendation, it helped!
But, I would not agree that this recommendation is the solution of root problem. Other peole still will face this problem, spending some time wondering what is going on, and only then start google the problem.
Doumentation does not specifies that setting
"rest-client.previewOption": "exchange"
shows all headers and does not hide any of them. In description, it is written “Preview the whole HTTP exchange(request and response)”. From this description I don’t get that before some headers were hidden and with this value they will become visible.I use this extensions to debug back-end calls, and cookies are used in many places. Because of this default behavior to save previously set cookies, I have made wrong assumptions about nature of the bug and spent several hours debugging, and onlythen I realized that something wrong with extensions’ behavior.
@Huachao , why you decided to make to make option “rest-client.rememberCookiesForSubsequentRequests” default value to be “true”. Has any surver been conducted and users voted that they need more browser-like behaviour?
I would propose
Does this help?
Change setting: “rest-client.previewOption”: “exchange”
Then you get (I believe) the full sent request.
Also, you can disable the Cookies: “rest-client.rememberCookiesForSubsequentRequests”: false
I’m assuming the cookies is enabled so you can do authentication and pass the cookies in subsequent calls easier. Personally I’ve turned this off to make each call explicit.