-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: File variables based on request variables #181
Comments
Just realized that my request looks a bit like #179 I'd say that the least surprising syntax is with the @ prefix ... |
@lldata nice suggestion, it's different from that. |
You could avoid holding all responses in memory, if you allowed a section below the request, that could post process the response. Like this:
Hope you get the idea. |
@lldata nice suggestion, script support is in my consideration, I'd like to provide some hooks(before request and after response) for user to write customize script. Add user just need to specify the script location in the request metadata like existing name metadata. For examle: # @name sample
# @script beforeRequest ./test1.js
# @script afterResponse ./test2.js
GET https://api.example.com |
I can see how you can support scripts in the comment section above the request. Would that work for my two other examples as well?
You are getting into the developing a DSL for testing HTTP. It is very useful and if you get it right, I could imagine that other tools could pick the format up and use it as well! |
I would also love the ability to set a variable from the response: e.g. That way I can have File level variables that can be overwritten by a request, and to allow a simple naming structure to more complex jsonpath queries |
@eamodio this feature is in my todo list. And I am still considering the design. |
@lldata @dakaraphi @eamodio @ReeganExE @itgoran I have implemented this feature and will publish in next release. The syntax would be the same as you suggested, like |
@lldata @dakaraphi @eamodio @ReeganExE @itgoran you can try the latest version 0.20.0 to verify this feature. |
It works, but I could get it a little confused if I by mistake named a variable the same as a request:
To reproduce run postjson request - mouseover on postjson variable in bottom of file. |
@lldata as I've mentioned in the |
Nice Feature Huachao very nice! |
@Huachao , script support has available? |
The new feature where you can use information from the response in the following request is very nice. But it could be improved. This is the current version:
I'd like if you could define a variable, with data captured from the response.
Like this:
Currently @commentId will have the value "{{createComment.response.body.$.id}}"
I'd expect the second example to do the same as the first.
The text was updated successfully, but these errors were encountered: