Lilacwine Graphics
Posts: 0
Joined: Mon Mar 23, 2015 6:09 pm

How to send params to a dynamic REST url programmatically?

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to send params to a dynamic REST url programmatically?

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";

Lilacwine Graphics
Posts: 0
Joined: Mon Mar 23, 2015 6:09 pm

How to send params to a dynamic REST url programmatically?

It works , thank you very much Sergiy!!

Return to “Issues”