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
His HTTP client allows binding a variable name to an HTTP request, so that the HTTP response becomes accessible via that name. It uses the syntax @name variable_name in a comment in the scope of the HTTP request.
Example:
###
# @name bananas
GET http://localhost/greeting
###
POST http://localhost/something/{{bananas.response.body.foo}}
{
"message": "{{bananas.response.body.greeting}}"
}
The example above assumes that:
GET http://localhost/greeting returns { "foo": 123, "greeting": "hello" }
The content type is application/json so that the response is automatically parsed as JSON
The rest is self-explanatory.
Once the response is received, it binds the response object to the bananas variable name.
The text was updated successfully, but these errors were encountered:
Request
Ability to refer to HTTP response data by name.
Implementation
A fellow named Huachao Mao wrote an amazing HTTP client for VSCode from which we can get some inspiration: https://github.com/Huachao/vscode-restclient
His HTTP client allows binding a variable name to an HTTP request, so that the HTTP response becomes accessible via that name. It uses the syntax
@name variable_name
in a comment in the scope of the HTTP request.Example:
The example above assumes that:
GET http://localhost/greeting
returns{ "foo": 123, "greeting": "hello" }
application/json
so that the response is automatically parsed as JSONThe rest is self-explanatory.
Once the response is received, it binds the response object to the
bananas
variable name.The text was updated successfully, but these errors were encountered: