AnWeber / httpbook

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://httpyac.github.io/
MIT License
57 stars 4 forks source link

Provide a way to suppress the output of a cell #110

Closed Spitfire1900 closed 6 months ago

Spitfire1900 commented 6 months ago

When making a request to an endpoint that returns a large json dictionary the entire editor is filled with the response body, provide a way to suppress the output of a cell, such that only the first lines is displayed, either through a VSCode setting or as a snippet in the cell body.

AnWeber commented 6 months ago

You could alter response with a script. Using @responseLogging only affects response used for outpt, using @response also changes response used for all purposes (see https://httpyac.github.io/guide/scripting.html#events)

GET https://postman-echo.com/get

{{@responseLogging
  response.body = response.body.slice(0,10);
}}

In this way, you can create an optimized display afterwards and also create Markdown, for example.

And again a similar topic to the other ticket. I would have tried to describe it, but good documentation is really hard. That's why I gladly accept help to improve it.