Skip to content

How to programmatically create request body before sending requests? #433

Closed Answered by boltlessengineer
uroybd asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for late reply. I constantly forgot about discussions tab. I should find way to subscribe this.

I’m not sure if intellij or vscode plugins support writing body from pre-request scripts.
One possible workout would be using variables like this:

### Dynamic query
# @lang lua
< {%
-- full json body that will be sent to server (in lua table)
local body = {
    -- graphql query you are going to use (raw string)
    query = [[
        query ($name: String!, $owner: String!) {
            repository(name: $name, owner: $owner) {
                name
                fullName: nameWithOwner
                description
                diskUsage
                forkCount
                stargaz…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@uroybd
Comment options

@boltlessengineer
Comment options

Answer selected by uroybd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants