Wrong ASCII Encoding in HTTP Request node?

Hi All!
I’m coming across an issue in having the right response from an API call:

As you can see from the screenshot, while passing a string like

page_token %3D eyJNIjp7InBrIjp7IkIiOiJKRGsyWmpBeVlqQTNMVFZrTlRndE5ERTVPUzFpTW1FeExXRTNOMlEzTW1VMk5ESXhNZz09In0sIl9za18iOnsiQiI6IkYwQjI2Nit2WEJPZHNlcU1BUT09In0sIl91c3cxXyI6eyJCIjoiQkxmWDhRTUJCUUVCIn19fQ %3D%3D%26

it seems to be returned differently, like the character % from %3D is being reinterpreted as %253D as per following response

page_token %253D eyJNIjp7InBrIjp7IkIiOiJKRGsyWmpBeVlqQTNMVFZrTlRndE5ERTVPUzFpTW1FeExXRTNOMlEzTW1VMk5ESXhNZz09In0sIl9za18iOnsiQiI6IkYwQjI2Nit2WEJPZHNlcU1BUT09In0sIl91c3cxXyI6eyJCIjoiQkxmWDhRTUJCUUVCIn19fQ %253D%253D%2526

I already tried exactly the same with a Python script without any issue, so it really seems that the HTTP Request node is doing some kind of manipulation to the string.

Have you ever experienced something like this? Any thought on how to avoid that? I’m really struggling with this…

Thank you!!

Hey @GBOL,

That is a bit odd, Which API are you using?

this is the exact APIs:

and this is an example of how the same is returned correctly in python:

Can you share the workflow you are using with any important values replaced with dummy text?

I can privately share you my workflow also including the sensible data for testing, how can I do that?
I mean share it directly to you? Maybe by giving me an upload link?
Many thanks for the help

Hey @GBOL,

We don’t really have an upload link, Is it not something you can paste here? The sensitive data can be removed I suspect we can make an account on ByBit for a quick test.

Don’t worry, I left my read-only keys, I’ll delete those once you tell me to do it :slight_smile:
Thanks!!

Hey @GBOL,

So this was a fun one, The signing is being done with the encoded url string and being sent then being encoded again to send which resulted in the odd data. The solution is to change the cursor value in the second request node to {{ $json.cursor.urlDecode() }} which then results in the second page being returned, Workflow is below.

2 Likes

Hey @Jon thank you so much!!! At a certain point I played too with urlencode/decode without understanding exactly what you figured out at the end, so thankfully you resolved me this issue!
Have a great weekend!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.