mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
21 lines
376 B
HTTP
21 lines
376 B
HTTP
### post-request script
|
|
GET https://jsonplaceholder.typicode.com/posts/3
|
|
|
|
# @lang=lua
|
|
> {%
|
|
local body = vim.json.decode(response.body)
|
|
client.global.set("postId", body.id)
|
|
-- ^ @lua
|
|
%}
|
|
|
|
|
|
### run request with variable
|
|
|
|
GET https://jsonplaceholder.typicode.com/posts/{{postId}}
|
|
|
|
> {%
|
|
client.global.set("auth_token", response.body.jwt);
|
|
// ^ @javascript
|
|
%}
|
|
|
|
### vim: ft=http
|