Square brackets in Form URL Encoded format when consuming a REST API

Trying to send the following query string with square bracket to Stripe API; however, Outsystems unable to recognize it as a input parameter.

owner[email] = john@doe.com 

If you're supplying the parameter in URL for API call, then encode the URL 

In your case, it should be as below

owner%5Bemail%5D%3Djohn%40doe.com

Swatantra Kumar wrote:

If you're supplying the parameter in URL for API call, then encode the URL 

In your case, it should be as below

owner%5Bemail%5D%3Djohn%40doe.com

No. I supplying in body not the URL.

I don't like % signs. Square bracket more clean, and in Postman test it work fine.  


I did try it with percent signs, and out systems doesn't recognize it either. 



Is this is a bug ?

Daniel Hobgood wrote:

Swatantra Kumar wrote:

If you're supplying the parameter in URL for API call, then encode the URL 

In your case, it should be as below

owner%5Bemail%5D%3Djohn%40doe.com

No. I supplying in body not the URL.

I don't like % signs. Square bracket more clean, and in Postman test it work fine.  



OutSystems has a different way of handeling [] in URL, hence it has to be encoded. Postman works differently. Although you confirmed it is not in the URL.

Daniel Hobgood wrote:

I did try it with percent signs, and out systems doesn't recognize it either. 




A different case as in body, but what is the POST payload and Response?

Swatantra Kumar wrote:

Daniel Hobgood wrote:

I did try it with percent signs, and out systems doesn't recognize it either. 




A different case as in body, but what is the POST payload and Response?


application/x-www-form-urlencoded








Up

x-www-form-urlencoded is the http payload content-type.


I would recommend to go on this playground and see the payloads in action.


Swatantra Kumar wrote:

I would recommend to go on this playground and see the payloads in action.



Don't you think I have not tried everything you say?


In fact, if you look at my earlier posts - you can find my problem, and all your suggestions didn't work.







Messaged Outsystems support, Let me see what they say about this. 


*Post edited on Dec. 27, 2019 by OutSystems staff - Original poster has been notified why*

Daniel Hobgood wrote:

Messaged Outsystems support, Let me see what they say about this. 

With due respect Daniel, this is DISCRIMINATION.

To harness from the knowledge of the community, this powerful platform MUST be used to discuss technical issues and approach. If one finds it difficult to follow any (unpaid) solution, either request for more detail/explanation or ignore it. Although you should be thankful that someone walked with you to solve the issue, but this response hurts...


*Post edited on Dec. 27, 2019 by OutSystems staff - Original poster has been notified why*

Swatantra Kumar wrote:

With due respect Daniel, this is DISCRIMINATION.

To harness from the knowledge of the community, this powerful platform MUST be used to discuss technical issues and approach. If one finds it difficult to follow any (unpaid) solution, either request for more detail/explanation or ignore it. Although you should be thankful that someone walked with you to solve the issue, but this response hurts...


The platform is WYSIWYG, and there are limitations what you could do with it. I generally hate this platform to be honest, because I have to spend hours researching solution for a simple problem. 

I definitely thankful for someone who help me but not for the one who waste my time on weekend with over poor solutions.


*Post edited on Dec. 27, 2019 by OutSystems staff - Original poster has been notified why*

Solution

It seems Outsystems doesn't support parameters with square brackets in other words nested form parameters in the body. 

I had to put the parameters with square brackets in the URL with braces for parameter values. That trick worked for me, but not so happy about it as It's not so elegant solution rather a tricky one. 


Solution