Replies: 4 comments 1 reply
-
@weigandn can you please confirm your subscription using below form before we look into your query. |
Beta Was this translation helpful? Give feedback.
-
@weigandn we will verify and get back to you |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting the issue We will review and try to address this issue by either Will update this in couple of days |
Beta Was this translation helpful? Give feedback.
-
We have implemented this feature in v2.25.5 Docs - https://docs.thunderclient.com/scripting/api#getbinary Release Notes Please test and let us know your feedback |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I am unsure if this topic may have been addressed before as I am relatively new to using Thunder Client, but I was unable to find any previous discussion posts over this topic myself. Please understand that I am using the paid version of Thunder Client.
When trying to write test scripts for my API request using the built-in Thunder Client methods, I have been running into some road blocks with their capabilities. My first road block came from the fact that the endpoint I am testing does not return text or json. It returns a binary file (application/pdf). Using the standard tc.response object, none of the available properties allow me to write a script for this binary response, as tc.response.text returns empty (most likely because it isn't text).
I ultimately concluded that the Thunder Client response object just simply isn't set up to handle binary response, so using the axios library, I manually created the request myself. This response does include the binary file as needed, so that was what I wanted, but then this is where my second road block came up. In order to test the proof of concept for this approach, I had simply hard coded my Auth token into the request. I want this token to still be dynamically refreshed using the oauth2 refresh that my requests have enabled.
To do this, I figured I could just use tc.request.getHeader('Authorization') and problem solved... but it also returns empty?
I apologize for the lack of any screenshots, but given my company's strict security policies, I am unable to use github from my laptop. I am just confused as to why the request header is now returning empty. I understand binary content might not be supported in the response object yet, but using getHeader for other headers in the request works perfectly... so it just seems strange that the auth header is not being passed back properly. Any guidance on this issue would be greatly appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions