libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.49k stars 924 forks source link

Redirect Doesn't works? #881

Closed vende11s closed 1 year ago

vende11s commented 1 year ago

Description

so I tried to download a file from a redirect link, tried this: auto r = cpr::Get(cpr::Url{ link }, cpr::Redirect{ -1L }); and this: auto r = cpr::Download(of, cpr::Url{ link }, cpr::Redirect{}); but both responses are 302 and empty r.text shouldn't it work like curl -iL?

Example/How to Reproduce

  1. Create cpr::Get or cpr::Download
  2. Add cpr::Redirect
  3. Try every option of cpr::Redirect
  4. See cpr::Response.status_code = 302 and .text.empty() = true

Possible Fix

-

Where did you get it from?

vcpkg

Additional Context/Your Environment

COM8 commented 1 year ago

Thanks for reporting! Yes, it should work like curl -iL. Does your website/download work if you use it via curl on your command line?

COM8 commented 1 year ago

Closing since no response. Feel free to reopen in case this is still an issue.