Page 1 of 1

How to send params to a dynamic REST url programmatically?

Posted: Fri Apr 17, 2015 3:58 pm
by Lilacwine Graphics

Hi!

I have a dynamic URL for a REST service in this form:

[url=http://my_url/my_category/{my_id}/my_articles]http://my_url/my_category/{my_id}/my_...[/url].

I know how to pass "my_id" parameter through the appery.io interface, but I need to execute that service a number of times inside a loop.

I tried executing it using the following syntax:

"service.execute({ data : {"my_id" : number} });",

but looking at the console log the link gets composed like so:

"[url=http://my_url/my_category//my_articles?my_id=number]http://my_url/my_category//my_article...[/url].".

What's the correct syntax to accomplish it?

Thanks in advance
Michele


How to send params to a dynamic REST url programmatically?

Posted: Fri Apr 17, 2015 5:18 pm
by Serhii Kulibaba

Hello,

Please follow steps below:

1) Add Service Settings with such parameters
2) Change such parameters in Service Settings before execute service:
service.service.__requestOptions.serviceSettings.my_id = "test";


How to send params to a dynamic REST url programmatically?

Posted: Fri Apr 17, 2015 5:41 pm
by Lilacwine Graphics

It works , thank you very much Sergiy!!