988
Views
4
Comments
REST API - Base URL as an input parameter
Question

Hi guys,

Is there a way to have a input parameter to define base url consuming a REST service?

I managed a dirty way to do it, using the OnBeforeRequest action and setting the CustomizedRequest.BaseURL based on a Site.Property, that is changed every time I need to use a different REST base url, but on concurrent calls it might use a wrong URL...

Any suggestion that avoids using integration studio to accomplish this without having issues?


Regards,
André

2018-05-16 11-16-36
João Heleno
 
MVP

@André

I would say OnBeforeRequest is the way to do it.

Instead of using Site Properties (that are cached in the front end) why don't you use a table in your app?

You configure the URL, save it in the DB and then you read the value in the OnBeforeRequest callback action...


2020-10-10 03-10-47
Andre Pinela

@João, I might overpass the frontend cache issue by using DB, you're right, but that wont solve the issue itself on concurrent calls, just'll make it happen fewer times.

Maybe it would be a nice improvement to the platform to allow specify the base URL if we want, don't you agree?

2018-03-26 14-20-06
Jordan Welch

There is an idea submitted for this, so if it is something you think should be there then you can vote!

Base URL for consumed REST services configurable at runtime

2020-10-10 03-10-47
Andre Pinela

Jordan Welch wrote:

There is an idea submitted for this, so if it is something you think should be there then you can vote!

Base URL for consumed REST services configurable at runtime

I didn't know! ;) It got my like!


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.