330
Views
15
Comments
Solved
Square brackets in Form URL Encoded format when consuming a REST API
Question

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 

UserImage.jpg
Daniel Hobgood
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. 


2018-09-27 18-20-33
Swatantra Kumar
Champion

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
UserImage.jpg
Daniel Hobgood

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.  


2018-09-27 18-20-33
Swatantra Kumar
Champion

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.

UserImage.jpg
Daniel Hobgood

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



2018-09-27 18-20-33
Swatantra Kumar
Champion

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?

UserImage.jpg
Daniel Hobgood

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








UserImage.jpg
Daniel Hobgood

Is this is a bug ?

UserImage.jpg
Daniel Hobgood

Up

2018-09-27 18-20-33
Swatantra Kumar
Champion

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


2018-09-27 18-20-33
Swatantra Kumar
Champion

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


UserImage.jpg
Daniel Hobgood

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.






UserImage.jpg
Daniel Hobgood


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*

2018-09-27 18-20-33
Swatantra Kumar
Champion

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*

UserImage.jpg
Daniel Hobgood

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*

UserImage.jpg
Daniel Hobgood
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. 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.