From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

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
Highlighted
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

View solution in original post


All Replies
Highlighted
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

-----------
Highlighted
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

View solution in original post

Highlighted
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

Highlighted
Forteen Stars

Re: how to send multiple request by using post method

welcome! Smiley Happy

-----------

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog