Multiple GET URL's


(Nick Papadatos) #1

Matrix Version: 6.44.1

Hello,

Just wondering if it’s possible to work with multiple GET URL’s in a HTTP request on a REST asset?

In my case I’m trying to work with 2 Funnleback API endpoints, possible?

Cheers
NickyP


(Byrne) #2

yep, you can use as many URLs as you like there.
That can get slow as the REST asset will wait for all the requests to complete.
You will need to process the REST in the JavaScript parser at the bottom of the asset.
Requests are usually in print(_REST.response.body);

But if you are making multiple requests you’ll find the body data in an array:
_REST.responses[0].body

To print all the data in the page and see what you are getting use:

var data =_REST.responses; 
print(JSON.stringify(data));

(Nick Papadatos) #3

Cool!, Thanks Andrew