Change in user domain using curl












1















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










share|improve this question





























    1















    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










    share|improve this question



























      1












      1








      1


      1






      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










      share|improve this question
















      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







      command-line server apache2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 14 at 9:10









      dessert

      24.6k672105




      24.6k672105










      asked Feb 14 at 9:07









      AdamAdam

      1337




      1337






















          2 Answers
          2






          active

          oldest

          votes


















          1














          If You need always get HTML result I recommend use using curl flag "-L":



          curl -L yahoo.com


          or



          curl -L https://www.yahoo.com


          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




          (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a
          3XX
          response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I,
          --head,
          headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial
          host. If
          a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on
          how to
          change this. You can limit the amount of redirects to follow by using the --max-redirs option.



          When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request
          with a
          GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following
          request
          using the same unmodified method.



          You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options
          for that:
          --post301, --post302 and --post303.







          share|improve this answer


























          • Thanks curl -L yahoo.com returns the full HTML output

            – Adam
            Feb 14 at 11:31



















          2














          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






          share|improve this answer
























          • Yeah the same thing occurs with out -basic appended

            – Adam
            Feb 14 at 11:28











          • And the same when I append --basic

            – Adam
            Feb 14 at 11:29











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1118160%2fchange-in-user-domain-using-curl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          If You need always get HTML result I recommend use using curl flag "-L":



          curl -L yahoo.com


          or



          curl -L https://www.yahoo.com


          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




          (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a
          3XX
          response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I,
          --head,
          headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial
          host. If
          a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on
          how to
          change this. You can limit the amount of redirects to follow by using the --max-redirs option.



          When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request
          with a
          GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following
          request
          using the same unmodified method.



          You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options
          for that:
          --post301, --post302 and --post303.







          share|improve this answer


























          • Thanks curl -L yahoo.com returns the full HTML output

            – Adam
            Feb 14 at 11:31
















          1














          If You need always get HTML result I recommend use using curl flag "-L":



          curl -L yahoo.com


          or



          curl -L https://www.yahoo.com


          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




          (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a
          3XX
          response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I,
          --head,
          headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial
          host. If
          a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on
          how to
          change this. You can limit the amount of redirects to follow by using the --max-redirs option.



          When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request
          with a
          GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following
          request
          using the same unmodified method.



          You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options
          for that:
          --post301, --post302 and --post303.







          share|improve this answer


























          • Thanks curl -L yahoo.com returns the full HTML output

            – Adam
            Feb 14 at 11:31














          1












          1








          1







          If You need always get HTML result I recommend use using curl flag "-L":



          curl -L yahoo.com


          or



          curl -L https://www.yahoo.com


          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




          (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a
          3XX
          response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I,
          --head,
          headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial
          host. If
          a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on
          how to
          change this. You can limit the amount of redirects to follow by using the --max-redirs option.



          When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request
          with a
          GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following
          request
          using the same unmodified method.



          You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options
          for that:
          --post301, --post302 and --post303.







          share|improve this answer















          If You need always get HTML result I recommend use using curl flag "-L":



          curl -L yahoo.com


          or



          curl -L https://www.yahoo.com


          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




          (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a
          3XX
          response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I,
          --head,
          headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial
          host. If
          a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on
          how to
          change this. You can limit the amount of redirects to follow by using the --max-redirs option.



          When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request
          with a
          GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following
          request
          using the same unmodified method.



          You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options
          for that:
          --post301, --post302 and --post303.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 14 at 9:29

























          answered Feb 14 at 9:22









          maturemature

          2,1524931




          2,1524931













          • Thanks curl -L yahoo.com returns the full HTML output

            – Adam
            Feb 14 at 11:31



















          • Thanks curl -L yahoo.com returns the full HTML output

            – Adam
            Feb 14 at 11:31

















          Thanks curl -L yahoo.com returns the full HTML output

          – Adam
          Feb 14 at 11:31





          Thanks curl -L yahoo.com returns the full HTML output

          – Adam
          Feb 14 at 11:31













          2














          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






          share|improve this answer
























          • Yeah the same thing occurs with out -basic appended

            – Adam
            Feb 14 at 11:28











          • And the same when I append --basic

            – Adam
            Feb 14 at 11:29
















          2














          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






          share|improve this answer
























          • Yeah the same thing occurs with out -basic appended

            – Adam
            Feb 14 at 11:28











          • And the same when I append --basic

            – Adam
            Feb 14 at 11:29














          2












          2








          2







          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 14 at 9:26









          KtiprKtipr

          213




          213













          • Yeah the same thing occurs with out -basic appended

            – Adam
            Feb 14 at 11:28











          • And the same when I append --basic

            – Adam
            Feb 14 at 11:29



















          • Yeah the same thing occurs with out -basic appended

            – Adam
            Feb 14 at 11:28











          • And the same when I append --basic

            – Adam
            Feb 14 at 11:29

















          Yeah the same thing occurs with out -basic appended

          – Adam
          Feb 14 at 11:28





          Yeah the same thing occurs with out -basic appended

          – Adam
          Feb 14 at 11:28













          And the same when I append --basic

          – Adam
          Feb 14 at 11:29





          And the same when I append --basic

          – Adam
          Feb 14 at 11:29


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1118160%2fchange-in-user-domain-using-curl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

          is 'sed' thread safe

          How to make a Squid Proxy server?