how to send multiple request by using post method

Highlighted
Four Stars

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

Screen Shot 2018-02-13 at 12.40.13.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?

 


Accepted Solutions
Four Stars

Re: how to send multiple request by using post method

@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

Screen Shot 2018-02-14 at 16.24.36.png


All Replies
Forteen Stars

Re: how to send multiple request by using post method

You need reed You file with tFileInutDelimited

then use tFlowToIterate for save each row to variable

 

for example:

Screen Shot 2018-02-14 at 3.04.36 AM.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

-----------
Four Stars

Re: how to send multiple request by using post method

@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

Screen Shot 2018-02-14 at 16.24.36.png

Forteen Stars

Re: how to send multiple request by using post method

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

-----------
Four Stars

Re: how to send multiple request by using post method

thank you so much

It's works perfectly

Screen Shot 2018-02-14 at 19.02.33.png

Forteen Stars

Re: how to send multiple request by using post method

welcome! Smiley Happy

-----------

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog