httpbook
httpbook copied to clipboard
support multiple requests in same code cell
Another great plugin from you! I am really impressed. However I faced a little problem. Here is my use case:
- run two requests in the same code cell
- render only response from the second request
FYI, the first request triggers a CI build and second request checks its results; it could be a common use case.
However it didn't work so well as is. I've tried:
- use
httpbook
with the VSCode built-in renderer, it displays response from both requests - use
httpbook
with thehttpBook - Monaco Editor Renderer
, it displays response from first request and doesn't refresh after second request completes - use
@no-log
on first request, now it breaks the variable referencedoe.user
and failes, however if I run it a second time, it seems able to resolve the variable somehow, from cached value maybe.
Below is a minimal example. It was really fun to use these plugins you've developed. I am not proficient in TS or VSCode plugin development; but let me see if I can get a grasp of them and contribute back.
###
@user = doe
@password = 12345678
# @name doe
GET https://httpbin.org/basic-auth/{{user}}/{{password}}
Authorization: Basic {{user}} {{password}}
###
# @ref doe
GET https://httpbin.org/basic-auth/{{doe.user}}worked/{{password}}
Authorization: Basic {{doe.user}}worked {{password}}
Two Requests in same Code Cell will not work. After saving and reloading, the two requests are split into separate code cells. I would have to add a unique seaparator for httpbook and then the http files would not be compatible between the tools (cli, vscode-httpyac, httpbook). You could probably build it, but is that really useful.
That it does not work with @no-log is a bug. : https://github.com/AnWeber/httpyac/blob/a54df9fe1f041fb09f8a2bd9c0e2d7545c690477/src/utils/httpRegionUtils.ts#L66-L68