REST with variable port number

REST with variable port number

  

I have a REST POST command I need to do where it is the format http://myurl.com:1234/something.  However, we want to have both the "1234" and the "something" be input variables.  So at one point we might want to do myurl.com:4322/bird and another time post myurl.com:1111/cow.  So what I would like to do is have the post set up as http://myurl.com:{Port}/{Text} and port and text are both input variables.  But it seems like it will not let you have a variable before the first "/".  Any suggestions?

change the baseUrl to http://myurl.com:1234/something

yes, but then that makes 1234 and something hard coded.  I want to have it such that the 1234 and the something are based on input variables.

Solution

why would you change ports runtime?

(it can be configured via servicecenter, btw, so it's not that hardcoded)


you can also change it via OnBeforeRequest

Solution

J. wrote:

why would you change ports runtime?

(it can be configured via servicecenter, btw, so it's not that hardcoded)


you can also change it via OnBeforeRequest

The url/port number is the url/port on the other computer that I am sending the post to.  It looks to me like they are using different ports for different things and we may want to dynamically change that at run time and I didn't want to have to make X number of REST items for each port number they may want to send to.

If I understand your response correctly, I am not wanting to change any port numbers on my OutSystems server, I am wanting to dynamically change what port number the REST is communicating to on the receiving server outside of my control.

HI Jason,


You can do that with an OnBeforeRequest action to change the base url dinamically in runtime.


Regards,
João Rosado

Ah ok!  Thank you.  That will do it.

J. wrote:

you can also change it via OnBeforeRequest

*cough* :P



J. wrote:

J. wrote:

you can also change it via OnBeforeRequest

*cough* :P



J. sorry!  Just saw that.  Marked yours as the solution as you said it first.