Inconsistencies in what the browser gets and curl gets

Source: Internet
Author: User
Return is a JSON string but I use Curl-l http://.... But can't get

Return

404 Not Found

404 Not Found

The requested URL /mauth/usr/exists was not found on this server.

Reply content:

Return is a JSON string but I use Curl-l http://.... But can't get

Return

404 Not Found

404 Not Found

The requested URL /mauth/usr/exists was not found on this server.

The problem later found that the network link problem, the implementation of curl that host and target server is isolated, can not access each other, egg pain!

User-agent, Cookies, Accept, referer and other parameters all affect the request result.

I usually first use fiddler to find the minimum required parameters and cookies, and then curl.

, the latest version of Chrome's JavaScript debugging tool already supports Curl replication (which can fully simulate browser access, including Header,cookie, operating system information, etc.), by first knocking down the network and then accessing this page Then right-click on the list and have a copy as curl. And then straight curl worked.

The URL is wrong to write ... or a service-side limit on user-agent ...

Use a mock-up of –user-agent other browsers to see ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.