We are consuming a REST API where the needed query string needs to be in the format:

{URLPath}?where=ShipmentFK=8308870&rowcount=10

When we test the URL in service studio it works fine, at runtime it fails however. When we look into the logging we see that the actual URL that is created by Outsystems is:

{URLPath}?where=8308870&rowcount=10

So it seems that OutSystems does not like the 2 equal signs for 1 parameter/value pair. I know it is quite a specific API definition, but I can't help that at the moment.

Question 1: Does anyone know whether I can somehow avoid this behaviour? I can maybe add the "ShipmentFK=" again in a OnBeforeRequest but that is a bit nasty and would only work if I don't have a second where clause.

Question 2: Why does OutSystems parse my initial query string anyway?

Kind regards,

Jarno

Have you tried to look / manipulate the query parameters with OnBeforeRequest action?

Another thing, maybe as first measure I’d try to url encode that equals sign in your ”where” parameter value and see if it helps. 

I think it’s either encoding or string tokenization where platform might be tripping in this case.

Hi Mikko,

Thanks for your response!

Yes I have analyzed the query parameters and there you see that part of the "where" parameter value is already lost.

I also tried encoding the equals sign, but that does not make a difference.

Manipulating the query parameters in the OnBeforeRequest is working, but does not work when we have more than one "where clause". For example if we would have an URL like {URLPath}?where=ShipmentFK=8308870 and PositionsNr=2&rowcount=10. I loose everything between the first and last equals sign in the where parameter, I also loose one of the ID's (which I can't fix in the OnBeforeRequest).

Jarno Pons wrote:

We are consuming a REST API where the needed query string needs to be in the format:

{URLPath}?where=ShipmentFK=8308870&rowcount=10

When we test the URL in service studio it works fine, at runtime it fails however. When we look into the logging we see that the actual URL that is created by Outsystems is:

{URLPath}?where=8308870&rowcount=10

So it seems that OutSystems does not like the 2 equal signs for 1 parameter/value pair. I know it is quite a specific API definition, but I can't help that at the moment.

Question 1: Does anyone know whether I can somehow avoid this behaviour? I can maybe add the "ShipmentFK=" again in a OnBeforeRequest but that is a bit nasty and would only work if I don't have a second where clause.

Question 2: Why does OutSystems parse my initial query string anyway?

Kind regards,

Jarno

Hi Jarno Pons,

I haven't tried it yet but I think use EncodeUrl() maybe help you.

Regards,