Closed GitCat3 closed 9 months ago
Curl does not follow redirects by default. You'll need to include easy.follow_location(true)
to enable it.
But shouldn't websites such as google.com not be saying I need to redirect anyway?
google.com
redirects to www.google.com
. You can test these things on the command-line with curl -v https://google.com/
.
thanks, I was dumb.
I have the following code:
but when I run it no matter which website I pass into the command line, it always returns 301 for some reason. Is this an issue or did I do something wrong? Thanks!
UPDATE: I tried changing the code back by commenting out the lines that get command line arguments, and it still returned 301 after that for some reason.