You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need DownloadStreamAsync version that allows reading the status code? #1823
Is your feature request related to a problem? Please describe.
Presently when you use DownloadStreamAsync, you just get the stream as a result. if the request fails for some reason, there is no way to get the status code (or as another user was asking for, a way to get the headers from the response also). In our case, sometimes we might get an unauthorized response if we need to regenerate auth key, so we check for that response, get the new auth key and then re-run the request. But we cannot do that if we cannot see the response status code.
Describe the solution you'd like
Either the DownloadStreamAsync function needs some functionality added to allow this, or a new overload created that would return the headers etc as well as the response data?
I think it was suggested previously that the response data could be made lazy, so you could read the response stream somehow via the normal Execute request if you need extra functionality from the download stream code?
Ahh, looking at the code I think your suggestion before might work here. I think we can use the OnAfterRequest callback for the request to be able to get the response message so we can do something useful with that (basically save it off to inspect later?) when the download action completes?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, sorry for reopening it, but how would you implement a workaround (at the very least throw an exception if not 20X is returned ) ?
Right now, I don't see a way to know if the server returned an error, so the stream will contains the error message from the server.
Activity
kendallb commentedon Mar 31, 2022
Ahh, looking at the code I think your suggestion before might work here. I think we can use the OnAfterRequest callback for the request to be able to get the response message so we can do something useful with that (basically save it off to inspect later?) when the download action completes?
If that is accurate we can close this out.
stale commentedon May 1, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
repo-ranger commentedon May 1, 2022
stale commentedon Aug 13, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
repo-ranger commentedon Aug 13, 2022
nssoft-rlagrange commentedon Apr 6, 2023
Hi, sorry for reopening it, but how would you implement a workaround (at the very least throw an exception if not 20X is returned ) ?
Right now, I don't see a way to know if the server returned an error, so the stream will contains the error message from the server.