Page 1 of 1

Post and Get with Wam

Posted: Tue Jul 31, 2018 11:40 am
by hoangtrungcs
Hello everybody!

How can post url and pass parameter to other website in Wam ?

Thank you so much!

Re: Post and Get with Wam

Posted: Tue Jul 31, 2018 1:51 pm
by AbelS
For POST, you need to do nothing special. The form that you post must have the fields you want to pass to your target webroutine (where they should be mapped for input)

For passing fields in the url, see: https://docs.lansa.com/14/en/lansa087/i ... s%7C_____3

PS: Fields must also be mapped for input in your target webroutine.

HTH

Re: Post and Get with Wam

Posted: Wed Aug 01, 2018 12:38 pm
by hoangtrungcs
Hi AbelS

Thank you so much! I will follow your link.

Re: Post and Get with Wam

Posted: Thu Aug 02, 2018 5:53 pm
by hoangtrungcs
Can I transfer to a outside link from Wam, not local link ?

Example:
I have form with HTML with some input of parameters, and one button Submit.
After I fill value for input = 123, I click submit button then in wam I set value to a default link as same https://abc.com/data?param=123
So how can I redirect to that link from wam or other solution is Ok?

Thank you so much !

Re: Post and Get with Wam

Posted: Fri Aug 03, 2018 9:36 am
by AbelS
You have to build the link yourself and use Javascript. For example see https://stackoverflow.com/questions/902 ... javascript

Re: Post and Get with Wam

Posted: Mon Aug 06, 2018 3:34 pm
by hoangtrungcs
Hi AbelS

Thank you for your support.

After build Javascript to redirect to another page(not LANSA page), then after processed that page will return value to LANSA.
The return url as same : https://ip/CGI-BIN/lansaweb?wam=ZTEST&w ... t=10000000

In LANSA I can not get value of additionData, and amount from link above, because in LANSA in order to get parameter from this url must have f()
==> https://ip/CGI-BIN/lansaweb?wam=ZTEST&w ... )=10000000

So do you have any solution to get value of parameter from above link without f() ?

Thank you so much !

Re: Post and Get with Wam

Posted: Tue Aug 07, 2018 8:44 am
by AbelS
If you don't want the fields in the url, create a form, add the fields you want to send to this form and post it.

HTH

Re: Post and Get with Wam

Posted: Tue Aug 07, 2018 9:16 am
by AbelS
I just noticed your field name is "additionData". You need to use the field id (short name) not the long name (See what the short name is in your LANSA repository)

Re: Post and Get with Wam

Posted: Tue Aug 07, 2018 1:32 pm
by hoangtrungcs
hi AbelS

Thank you so much for your support
I just create test flow in attached file.
In attached at process ③ I will receive the return parameter from target website, but in this url return don't include f() for LANSA get paramter.
So I think I should get value of these parameter from Javascript or you can get value from response target url in Wam ?

Re: Post and Get with Wam

Posted: Wed Aug 08, 2018 7:55 am
by AbelS
  • To pass a field value in the url you have to use the f() notation. If you don't have control on the format of the url from the target website, you will need to write a script that receives the request, translates it to the format required by a WAM and redirects the request
  • Ensure that you are using the field identifier and not the long name (your last example shows the long name)

Re: Post and Get with Wam

Posted: Thu Aug 09, 2018 11:33 am
by hoangtrungcs
Hi Abels

Thank you so much for your support!