signnow / SignNow.NET

SignNow.Net is the official .NET 4.5+ and .NET Standard class library for the SignNow API. SignNow allows you to embed legally-binding e-signatures into your app, CRM or cloud storage. Send documents for signature directly from your website. Invite multiple signers to finalize contracts.
https://www.signnow.com/developers
MIT License
16 stars 12 forks source link

One time download link does not work with .NET HttpClient #140

Closed chashik closed 1 year ago

chashik commented 2 years ago

I've encountered a problem with local API client. I've obtained one time download link with the SignNow.NET API client as described here: https://docs.signnow.com/docs/signnow/b3A6NDAwNjQwNTY-get-document-download-link Download link works fine via web-browser. But if I try to download via .NET HttpClient the request fails with 400 Http status code: image Do I miss headers or anything else? Yet DownloadDocumentResponse alternative is not very convenient for integration with our current project. Thanks in advance.

AlexNDRmac commented 2 years ago

Hi @chashik. You missed redirect. One time download link - its not a direct download link. You should handle Response with 3xx code and read location from response headers. Use this link from location to read the file content.

chashik commented 2 years ago

Hi @chashik. You missed redirect. One time download link - its not a direct download link. You should handle Response with 3xx code and read location from response headers. Use this link from location to read the file content.

Thank you, missed redirect and response analysis at all. Switched to Stream download but will finish up on that one too.