URLs include space  do not work for Consume REST API

URLs include space  do not work for Consume REST API

  
Like: http://rest.example.com/rest?summary=example%20example%20example

When I use the above link in web browser and other REST clients, it works well. But it doesn't work in OutSystems.

Is it a bug? Or anything wrong?
Hi Cyrus,

I'll check it, are you using .Net or Java?
Anyway, as workaround did you try to pass that variable as argument?


http://rest.example.com/rest?summary={summary}

And passing the "example example example" as input?

Regards,
João Rosado
João Rosado wrote:
Hi Cyrus,

I'll check it, are you using .Net or Java?
Anyway, as workaround did you try to pass that variable as argument?


http://rest.example.com/rest?summary={summary}

And passing the "example example example" as input?

Regards,
João Rosado
Hi Joao 

 Yes, .Net is used in my program.
And I have tried what you say before I post this question. But It didn't work.
Hi Cyrus,

I did some tests and the way using the input works for me.
It doesn't send "%20", but sends "+" instead. Both are technically correct, but "+" the recommended way to encode spaces in urls after the "?" according to the RFC1738 (see the "The application/x-www-form-urlencoded type" section in wikipedia for a summary version)
Can also read here the difference between the .Net methods for UrlEncode (to use on query string parameters) and UrlPathEncode (for the url part until the ?).




Result (in a server mock that just outputs what it gets):



Now ..using it without the parameter is indeed broken as it is sending the url as double encoded:



We will see why it's not working in this way ...but my initial solution (and what I would recommend doing anyway) should work correctly.

Regards,
João Rosado

Just did another test actually defining in Service Studio the url with the spaces instead of the %20 also makes it work correctly ..even tho it is strange to define a badly encoded url there, it would also work as workaround:




Regards,
João Rosado