Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show request headers as well as response #99

Closed
wprater opened this issue May 22, 2017 · 14 comments
Closed

Show request headers as well as response #99

wprater opened this issue May 22, 2017 · 14 comments

Comments

@wprater
Copy link

wprater commented May 22, 2017

Would be very nice to show the actual request headers and well as the response headers/body. nice for debugging or when you need to share the complete req/response.

@Huachao
Copy link
Owner

Huachao commented May 23, 2017

@wprater I will think about this carefully, and maybe add a new option to show what you need 😄

@wprater
Copy link
Author

wprater commented May 23, 2017

could be "save (or copy) response with headers" from the icons in toolbar?

@Huachao
Copy link
Owner

Huachao commented May 23, 2017

@wprater do you mean I just need to provide a way to save response with request headers(or even more request info like request url and body) and still keep rendering response as before(no request info)?

@wprater
Copy link
Author

wprater commented May 24, 2017

actually, I never save a response. I would just copy and paste.

I think what we need here is like a verbose option, that would show the headers?

@Huachao
Copy link
Owner

Huachao commented May 24, 2017

@wprater Got, that means you needs an option to display the response with request information, and by default this option is disabled

@wprater
Copy link
Author

wprater commented Jun 15, 2017

ideally we could show the request above the response, similar to how httpie does it

GET /foo?bar=baz HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8080
User-Agent: HTTPie/0.9.8



HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: application/json
Date: Thu, 15 Jun 2017 02:51:30 GMT
Server: CouchDB/2.0.0 (Erlang OTP/17)
Transfer-Encoding: chunked
X-Couch-Request-ID: cb614bb0fb
X-CouchDB-Body-Time: 0

{}

@borekb
Copy link

borekb commented Jul 21, 2017

Would be very useful for me as well. I sometimes copy/paste cURL into .http and would then like to see what was actually sent to the server in the HTTP format.

@richarddavenport
Copy link

I would love to see the request about the response as well and then the body below both the request/response.

@Huachao
Copy link
Owner

Huachao commented Sep 26, 2017

@wprater @richarddavenport @borekb @ReeganExE you can try the latest version 0.15.3 to preview expected part of response with the option rest-client.previewOption:

Option Description
full Default. Full response is previewed
headers Only the response headers(including status line) are previewed
body Only the response body is previewed
exchange Preview the whole HTTP exchange(request and response)

@borekb
Copy link

borekb commented Sep 26, 2017

Nice! I'm plying with it and the settings works nicely. One possible UI suggestion is to consider the settings as the default value but have some button next to 'Save Response' and 'Save Response Body' to toggle the output. For example, I'd probably keep just the response (full) as a default but peek occasionally at the full exchange but using this button. Just an idea.

@Huachao
Copy link
Owner

Huachao commented Sep 26, 2017

@borekb nice suggestion, I will consider it carefully.

@ichtestemalwieder
Copy link

For all those coming in via Google and are new to rest-client. It took me too much time to figure this out:
You need to set this "rest-client.previewOption": "exchange" parameter in your VSC Config File (settings.json) => CTRL+SHIFT+P => Open Settings JSON.

@Huachao Thanks very much for the absolutely great Extension!

@boxy-robot
Copy link

bless you @ichtestemalwieder 🙏

@tijujohn83
Copy link

thank you @ichtestemalwieder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants