REST API - Base URL as an input parameter

REST API - Base URL as an input parameter

  

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é

@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...


@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?

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

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!