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.
@wprater I will think about this carefully, and maybe add a new option to show what you need 馃槃
could be "save (or copy) response with headers" from the icons in toolbar?
@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)?
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?
@wprater Got, that means you needs an option to display the response with request information, and by default this option is disabled
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
{}
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.
I would love to see the request about the response as well and then the body below both the request/response.
@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)
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.
@borekb nice suggestion, I will consider it carefully.
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!
bless you @ichtestemalwieder 馃檹
Most helpful comment
@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)