I am sending the url to my server connect but the forward slashes are kind of encoded with a backslash before it..
This is the url /myurl/somedir/another dir/ and that is what I need, but is is received by the SC component as \/myurl\/somedir\/another dir\/
Is there a solution for this?
I also tried to replace them in a string replace function but I could not get it working.
The issue is probably related to the encoding of forward slashes (/) being escaped with a backslash (\) when passing the URL string to the script due to JSON encoding.
So why isn't is decoded in the SC, and how can this be done?
Perfectly clear, thank you for the images. I would have done it exactly the same. In other posts, you appear to be using PHP for your server-side scripting. Passing a string with a forward slash in a URL parameter, is most likely being encoded by PHP at runtime, server-side. This is because the server-side PHP framework thinks you wouldn't want it to be interpreted as a path separator, as that could be risky. But this is exactly what you're hoping to do.
My suggestion is to not pass parameters over $_GET with path separators "/". If there's a specific part of the path you need to know server-side, pass that specific part of the path over the URL. There's a 'rawurldecode' function in PHP. Do you see that as a formatter option server-side when looking at your Set Variable step?
There are also a lot of text formatters available in Wappler server-side. If you just need a specific part of the path in your SC API, then you could try various approaches to getting the specific part of the path that matters. If you need the entire path, then there's a decision on where to split it up: client-side with multiple URL key=value pairs, or server-side using the text formatters to remove the backslashes.
What is the exact expression you're sending from your page via the GET param? Do you modify the pathname when binding it to the server action on the page?
But it is the normal way to send this value to the backend - it's escaped.
The backend (Server connect) handle these escaped slashes without issues. Even if you try to output the value on the page it will be correct. You can also see it in the Preview tab in the browser (left of the Response)
Ah alright...
So the Preview tab shows the actual values used by the scripts?
It is because when I test the database query in Wappler with the Test Value for the condition parameter it works fine but with on the live server I get no results: