You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering if there's no (much) more compact way to express the following:
# Get free
GET {{base}}/getmytoken
# @lang=lua
> {%
local body = vim.json.decode(response.body)
client.global.set("regtoken", body.regtoken)
%}
### test contents of response
POST https://httpbin.org/post HTTP/1
Content-Type: application/json
{
"regtoken": "{{regtoken}}"
}
For that matter, I also tried without @lang=lua which, according to the spec, would default to javascript, but this didn't work, presumably because the lua env has no access to a js interpreter?
But anyway, I would expect there to be an automatic variable containing the last response which could be used directly?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Just wondering if there's no (much) more compact way to express the following:
For that matter, I also tried without
@lang=lua
which, according to the spec, would default to javascript, but this didn't work, presumably because the lua env has no access to a js interpreter?But anyway, I would expect there to be an automatic variable containing the last response which could be used directly?
Beta Was this translation helpful? Give feedback.
All reactions