Forum Discussion

gcampan's avatar
gcampan
Occasional Contributor
9 years ago

Characters in XML response get entitized and string becomes unusable as HTTP request

Hello!

 

I have this problem: issue a HTTP GET to a resource, and receive an XML response containing a URL where I can PUT a file.

Like this:

 

Now, I want to use the URL string from the first response inside as a PUT request URL.

I created a HTTP Request step and used a Property Transfer to transfer the string into the Request URL field in the HTTP Request. However, the string is changed, for example the % character is transformed into %25, that is its xml equivalent.

For example:

 

https://myserver.com/blob_a9f1404c-a7cf-4df3-a141-3a399b880d49.zip?sig=o%252FIWUx9hzK7uq3%252B5sHnZph98kqPM5u3iZMbx%252FE6TqHY%253D&st=2016-05-31T14%253A54%253A32Z&se=2016-06-01T14%253A59%253A32Z&sv=2015-04-05&sp=w&sr=b HTTP/1.1

 

gets turned into this
https://myserver.com/blob_a9f1404c-a7cf-4df3-a141-3a399b880d49.zip?sig=o%2FIWUx9hzK7uq3%2B5sHnZph98kqPM5u3iZMbx%2FE6TqHY%3D&st=2016-05-31T14%3A54%3A32Z&se=2016-06-01T14%3A59%3A32Z&sv=2015-04-05&sp=w&sr=b HTTP/1.1

 

Of course, this makes the server return an error because of an unknown sig parameter.

I just want the string transfered 1 to 1. Any solution I have tried is too complicated even impossible. (tried extracting all the params inside a groovy code, does not really work and it's too complicated etc)

 

Please advise.

 

  • Hello,

     

    Try enabling the "URI contains encoded endpoints, don't try to re-encode" option on the "HTTP" tab in R!API Preferences. This will force R!API to use the URL in your second request as-is without transforming it.

  • Hello,

     

    Try enabling the "URI contains encoded endpoints, don't try to re-encode" option on the "HTTP" tab in R!API Preferences. This will force R!API to use the URL in your second request as-is without transforming it.

    • gcampan's avatar
      gcampan
      Occasional Contributor

      Works as a charm, thank you!