Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
olja
Contributor
Contributor

How to consume a rest service which needs a json input object?

Hi,

 

I want to consume a rest service which requires a json as input body. Actually I am trying this with tRestClient but I do not know where to define the input body . The input body should be something like this:

 

{"username":"foo",
"password":"bar"
}

 

When I edit the input scheme then I can see that there is a row for body and string but not editable. I thought I can define there my json input. Also I could not find a valid example where this is shown. Do I need to read this input from a file with the tFileInputJson but how will it be added as body in the tRestclient?

Would be great if someone knows how to solve that.

 

0683p000009MA79.png0683p000009MA1C.png

 

 

Labels (3)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@olja , use tRest component use below way the input body in HTTP Boday and HTTP Heder you nee to specify"Content-Type" as name  "application/json" as value .

 

boday like below based on your 

 

"{\"username\":\"foo\",

\"password\":\"bar\"
}

"

View solution in original post

1 Reply
manodwhb
Champion II
Champion II

@olja , use tRest component use below way the input body in HTTP Boday and HTTP Heder you nee to specify"Content-Type" as name  "application/json" as value .

 

boday like below based on your 

 

"{\"username\":\"foo\",

\"password\":\"bar\"
}

"