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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hiba1
Contributor
Contributor

trestClient: how to set body in POST request

Hi,

i need to set body in prost request using trestClient.

the body:

<Request>

<Head>

<Username>[Your Username]</Username>

<Password>[Your Password]</Password>

<RequestType>GetCountries</RequestType>

</Head>

<Body/>

</Request>

in postman :

0693p00000AcdV6AAJ.png

the requests should be sent to the server with the "xml" parameter name using the HTTP POST method.

0693p00000AcdbdAAB.png

how can i do this ......

Labels (4)
4 Replies
manodwhb
Champion II
Champion II

@hiba chaieb​ , The body should be passed as input schema to tRestclient check the below example.

 

https://wynandbooysen.com/posts/2019-07-08-talend-tip-posting-json-with-trestclient/

 

Thanks,

Manohar

hiba1
Contributor
Contributor
Author

Hi @Manohar B​ 

 

thanks for reply.

 

how i call the key "xml" in trestClient ....the body must be in a variable called "xml" like in the screenshot in postman.

 

 

Thanks,

Hiba

manodwhb
Champion II
Champion II

@hiba chaieb​ ,check this case answer accept type selected xml like that you need to configure.

 

https://community.talend.com/s/feed/0D73p000004kWEVCA2

 

Thanks,

Manohar

hiba1
Contributor
Contributor
Author

i didn't get the result :

0693p00000BAosEAAT.pngAll XML requests should be sent to the server with the "xml" parameter name using the HTTP POST method.

the body is :

<Request>

<Head>

<Username>[Your Username]</Username>

<Password>[Your Password]</Password>

<RequestType>GetCountries</RequestType>

</Head>

<Body/>

</Request>