Use %20 instead of + to encode spaces when submitting a form using GET method

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

Shingo Lam wrote:

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

 Hi Shingo,

thanks for reply me, Yes. I know %2B is + sign and %20 is space sign. and Odata accept the %20 as space And I wanted to say that when ever I used space or %20 in query parameter for example:

 .../UserTodoLearningItems?$filter=criteria/includeDeeplink eq true OR

.../UserTodoLearningItems?$filter=criteria/includeDeeplink%20eq%20true

then OutSystem automatically change those to plus sign as you can seen in below image.

 

And regarding the "On Before Request", I have already tried it but I don't know how can I replace this + sign with space or %20 in "On Before Request"

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

 Hi Shingo,

thanks for reply me, Yes. I know %2B is + sign and %20 is space sign. and Odata accept the %20 as space And I wanted to say that when ever I used space or %20 in query parameter for example:

 .../UserTodoLearningItems?$filter=criteria/includeDeeplink eq true OR

.../UserTodoLearningItems?$filter=criteria/includeDeeplink%20eq%20true

then OutSystem automatically change those to plus sign as you can seen in below image.

 

And regarding the "On Before Request", I have already tried it but I don't know how can I replace this + sign with space or %20 in "On Before Request"

Hi,

I think you should check if the data you received in the "On Before Request" is correct. If not, please replace the + with space, else try to encode the url when call to the end point api

Hope this help

 

Shingo Lam wrote:

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

 Hi Shingo,

thanks for reply me, Yes. I know %2B is + sign and %20 is space sign. and Odata accept the %20 as space And I wanted to say that when ever I used space or %20 in query parameter for example:

 .../UserTodoLearningItems?$filter=criteria/includeDeeplink eq true OR

.../UserTodoLearningItems?$filter=criteria/includeDeeplink%20eq%20true

then OutSystem automatically change those to plus sign as you can seen in below image.

 

And regarding the "On Before Request", I have already tried it but I don't know how can I replace this + sign with space or %20 in "On Before Request"

Hi,

I think you should check if the data you received in the "On Before Request" is correct. If not, please replace the + with space, else try to encode the url when call to the end point api

Hope this help

 

 

Hi Shingo,

I can not see the + sign in "OnBeforeRequest" in Query parameter so that I can replace it. check the below image, the value of query parameter is still same in "OnBeforeRequest" so how can we get the generated request URL then we will know that final URL which OutSystem is requesting.

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

 Hi Shingo,

thanks for reply me, Yes. I know %2B is + sign and %20 is space sign. and Odata accept the %20 as space And I wanted to say that when ever I used space or %20 in query parameter for example:

 .../UserTodoLearningItems?$filter=criteria/includeDeeplink eq true OR

.../UserTodoLearningItems?$filter=criteria/includeDeeplink%20eq%20true

then OutSystem automatically change those to plus sign as you can seen in below image.

 

And regarding the "On Before Request", I have already tried it but I don't know how can I replace this + sign with space or %20 in "On Before Request"

Hi,

I think you should check if the data you received in the "On Before Request" is correct. If not, please replace the + with space, else try to encode the url when call to the end point api

Hope this help

 

 

Hi Shingo,

I can not see the + sign in "OnBeforeRequest" in Query parameter so that I can replace it. check the below image, the value of query parameter is still same in "OnBeforeRequest" so how can we get the generated request URL then we will know that final URL which OutSystem is requesting.

Hi,

I see.

So you can try one of these:

  1. encode the Value before call api 
  2. use js to call api and get back data from callback

Hope this help

 

Shingo Lam wrote:

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

Shingo Lam wrote:

Sanjay kumar wrote:

When I create the get request with query parameter that contains the space then it automatically encoded as a + and not as %20. If any of the values of my query parameters have spaces in them, they will be automatically URL encoded on execution of the query. I am using REST API to call odata request.

In OData a plus character is used for expansion of child records and is treated as a special character. Is there any way that outsystem does not change the %20 or space to + sign?

Thanks 

Hi,

At first, I think a + sign should be %2B, not %20

Secondly, with REST api, OutSystems provides you the "On Before Request", you can implement things to prevent the conversion here

Hope this help

 

 Hi Shingo,

thanks for reply me, Yes. I know %2B is + sign and %20 is space sign. and Odata accept the %20 as space And I wanted to say that when ever I used space or %20 in query parameter for example:

 .../UserTodoLearningItems?$filter=criteria/includeDeeplink eq true OR

.../UserTodoLearningItems?$filter=criteria/includeDeeplink%20eq%20true

then OutSystem automatically change those to plus sign as you can seen in below image.

 

And regarding the "On Before Request", I have already tried it but I don't know how can I replace this + sign with space or %20 in "On Before Request"

Hi,

I think you should check if the data you received in the "On Before Request" is correct. If not, please replace the + with space, else try to encode the url when call to the end point api

Hope this help

 

 

Hi Shingo,

I can not see the + sign in "OnBeforeRequest" in Query parameter so that I can replace it. check the below image, the value of query parameter is still same in "OnBeforeRequest" so how can we get the generated request URL then we will know that final URL which OutSystem is requesting.

Hi,

I see.

So you can try one of these:

  1. encode the Value before call api 
  2. use js to call api and get back data from callback

Hope this help

 

 

 hi,

Thanks for your responses, can you tell me how can I use JS to call the rest api.