Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to send multiple request by using post method

(Sorry about my bad english)

I want to send multiple http request by using post method 

I'm using tHttpRequest to call api like picture

0683p000009Ls5g.png

 

using post method with parameters read from .txt file. Like above

login_id=7777&system_cd=1&role_cd=1
login_id=9999999999999&system_cd=1&role_cd=1

 

It's works. But it send two request of first parameters line

login_id=7777&system_cd=1&role_cd=1

 

second parameters line, could not send

login_id=9999999999999&system_cd=1&role_cd=1

 

How to send multiple request by using post method?

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

@vapukov Thank you so much for supporting me

 

But i want to use post request. I can't set URL like this

"http://localhost/auth2/v1/api/lock"+((String)globalMap.get("row3.parameter"))

For POST request, you must specify a file that contains the Post parameters. 

(https://www.talendbyexample.com/talend-thttprequest-component.html)

 

I have answer in stackoverflow post

https://stackoverflow.com/questions/48764121/how-to-send-multiple-request-by-using-post-method/48764...

 

This is a solution

0683p000009LsHy.png

View solution in original post

5 Replies
vapukov
Master II
Master II

You need reed You file with tFileInutDelimited

then use tFlowToIterate for save each row to variable

 

for example:

0683p000009LsbQ.png

-if Your file contain 1 row with full parameter for each iteration

login_id=7777&system_cd=1&role_cd=1
login_id=9999999999999&system_cd=1&role_cd=1 

 use delimiter | and schema with single column - parameters (String)

 

and change Your URI to :

"http://localhost/auth2/v1/api/lock"+((String)globalMap.get("row3.parameter"))

row3 - need change to real row number in Your Job

tJavaFlex - empty, just dummy connector (or debug information print)

Your tHTTP request - somewhere right from sample picture, connected by OnSubJobOk from tJavaFlex

Anonymous
Not applicable
Author

@vapukov Thank you so much for supporting me

 

But i want to use post request. I can't set URL like this

"http://localhost/auth2/v1/api/lock"+((String)globalMap.get("row3.parameter"))

For POST request, you must specify a file that contains the Post parameters. 

(https://www.talendbyexample.com/talend-thttprequest-component.html)

 

I have answer in stackoverflow post

https://stackoverflow.com/questions/48764121/how-to-send-multiple-request-by-using-post-method/48764...

 

This is a solution

0683p000009LsHy.png

vapukov
Master II
Master II

same idea, and why not use tRESTClient? it support POST

Anonymous
Not applicable
Author

thank you so much

It's works perfectly

0683p000009LsHP.png

vapukov
Master II
Master II

welcome! 0683p000009MACn.png