When I enter the command:
$curl -basic https://www.google.com$
The output I receive is simply the text for the html page that we see when we visit the website.
but when I execute:
$curl -basic https://www.yahoo.com$
I receive no output, and the domain in my terminal changes from username@computer_name
to Regional Redirectusername@computername
.
What does this mean? I'm just not comfortable with that seeing I had thought what I was doing was sending a request to receive the text based content on the index page for a www domain. I apologize if this question is too vague, but I'd definitely like to know what the difference is here.
Thanks in advance
You should know that when you add the option
-basic
you actually set multiple parameters. What you might have wanted to do is--basic
for basic authentication. Also the final$
sign is probably a typo.If you execute the following, do you get the same unexpected behavior?
curl https://www.yahoo.com
If You need always get HTML result I recommend use using curl flag "-L":
or
This flag force curl follow all URL redirects (graphical browser behavior). In case when site will redirect you couple of times, for example, to regional version, you always have chance get final HTML.
From curl man:
-L, --location