09-28-2021 07:21 PM
I have a URL that generates a bunch of XML when you hit it. At the end of the URL, there are a whole bunch of parameters with spaces in them. For example:
?inputXml=<Envelope version="01.00"> <Sender>
When I copy and paste the URL into the REST Get Snap, it doesn’t work. But, if I put the URL in the browser, the browser encodes the spaces
?inputXml=<Envelope%20version="01.00">%20<Sender>
And, if I copy and paste that into the REST Get Snap, it works. Is there an easier way to do that?
09-28-2021 09:07 PM
In the REST Get snap, the Service URL requires a valid URL, which can’t contain spaces – spaces and other special characters have to be encoded.
However, the section of the URL after the ? are called the query parameters. This substring consists of name=value pairs, separated by & characters. You can put that string at the end of the URL, but you have to encode the special characters if you do. Alternatively, the REST Get snap has a property table for the Query Parameters. If you enter name/value pairs in that table, they will be appended to the Service URL using the correct syntax, and encoding any special characters. For your example, you would put a query parameter row with name = inputXml
and value = <Envelope version="01.00"> <Sender>
. For the Service URL, you would remove everything starting at the question mark.
Hope that helps.