Skip to content

intellij pre js script cant execute #534

Closed
@gejun123456

Description

from following link https://www.jetbrains.com/help/idea/exploring-http-syntax.html#per_request_variables

< {%
request.variables.set("firstname", "John")
%}
GET http://example.org/{{firstname}}

And

< {%
const signature = crypto.hmac.sha256()
.withTextSecret(request.environment.get("secret")) // get variable from http-client.private.env.json
.updateWithText(request.body.tryGetSubstituted())
.digest().toHex();
request.variables.set("signature", signature)

const hash = crypto.sha256()
    .updateWithText(request.body.tryGetSubstituted())
    .digest().toHex();
request.variables.set("hash", hash)

%}
POST https://httpbin.org/post
X-My-Signature: {{signature}}
X-My-Hash: {{hash}}
Content-Type: application/json

the script not works.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions