vscode-restclient icon indicating copy to clipboard operation
vscode-restclient copied to clipboard

response preview render

Open rhythmk opened this issue 6 years ago • 12 comments

I send a request to servers and get a page status is 500. This page contains a glorified error message 。 Can I use this to see the results returned, as in the browser?

rhythmk avatar Jan 24 '19 07:01 rhythmk

@rhythmk you mean render the html page, currently it's not supported.

Huachao avatar Jan 24 '19 07:01 Huachao

@rhythmk you mean render the html page, currently it's not supported.

sorry, I didn't find the operation method

rhythmk avatar Jan 24 '19 08:01 rhythmk

@rhythmk what's do you mean the operation method?

Huachao avatar Jan 24 '19 08:01 Huachao

Are there plans to support this? If not, would you consider accepting a PR for this feature? I was thinking just a view as HTML button in the editor toolbar.

skamansam avatar Oct 04 '19 20:10 skamansam

I think HTML preview is best addition to this extension. I have almost stop using Postman since started using this extension but sometime I force to use postman just because of this capabilities not available.

thecfguy avatar Dec 11 '19 05:12 thecfguy

Are there plans to support this? If not, would you consider accepting a PR for this feature? I was thinking just a view as HTML button in the editor toolbar.

@skamansam sorry for the late reply, a PR is warmly welcomed

Huachao avatar Dec 11 '19 06:12 Huachao

@Huachao What is the default way that Rest Client displays the response?

I'm guessing we could replace that view with the WebView API and things would work?

dufferzafar avatar Apr 09 '20 16:04 dufferzafar

@dufferzafar actually the extension is built on the WebView API, however, I just treat all the response body as the code text that inserted into the <pre><code> HTML tag

Huachao avatar Apr 10 '20 00:04 Huachao

Okay. Can you please point me to where this actually happens in the code? I'll see what changes we'd have to make to get the full previews working in the webview.

dufferzafar avatar Apr 10 '20 08:04 dufferzafar

@dufferzafar actually this is by design since normally we want to view the actual response, I think we can add an option to render the HTML response instead of raw data. https://github.com/Huachao/vscode-restclient/blob/666180c9aad50083477f246abc16489848d8051c/src/views/httpResponseWebview.ts#L188-L227

Huachao avatar Apr 10 '20 08:04 Huachao

+1 for rendering HTML preview

Stetzon avatar Apr 21 '21 23:04 Stetzon

The pull request looks good, the feature was built, does anyone know why it was not integrated and when HTML Preview will be possible? Just when e.g. a Laravel API or a Symfony app does a dump/dump&die, the output will be scripted and has to be parsed through a webview first.

mk-git avatar Jul 01 '22 05:07 mk-git

+1 for rendering HTML preview

WebRegul avatar Oct 26 '22 16:10 WebRegul