-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enable pre- and post-request scripting support. #154
Conversation
6be2001
to
e9a29b4
Compare
024372b
to
e179d95
Compare
Is there support for using libraries in scripts? Like In postman, I can use it like this. const randomDate = require('moment')().format('YYYY-MM-DD HH:mm:ss') |
If you have that package 📦 installed globally 🌎 or local to that |
1d3bdf8
to
77a33f7
Compare
Should work like that: https://kulala.mwco.app/docs/scripts/overview#using-node-modules Given a folder struct like this:
I can run this # @name REQUEST_ONE
POST https://httpbin.org/post HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer Foo:bar
{
"foo": "bar"
}
> ./../scripts/script.js
###
# @name REQUEST_TWO
POST https://httpbin.org/post HTTP/1.1
accept: application/json
content-type: application/json
{
"token": "{{REQUEST_ONE.response.body.$.json.foo}}",
"gorilla": "{{RANDOM_DATE}}"
} And the contents of
|
Enable pre- and post-request scripting support.
Example inline
Example file
This matches the this behaviour.