A solution to the truncation of multiple parameters of Linux curl GET request Parameters __linux

Source: Internet
Author: User
Tags curl

Recently do group purchase related services, using Linux under the Curl command to request the purchase of XML information, today in the use of Curl access to a link when a very strange phenomenon, the request of the url:http://api.union.meituan.com/data/ Api?city=%e5%8c%97%e4%ba%ac&limit=10&key=xxxxx&sort=1

The printed content looks like this:



See here a bit Meng, the good URL was truncated.

Finally found the reason on Google:& in the shell script has a special meaning (run in daemon) so as long as the & before the addition of backslash \ escape on the OK.

As follows:

Http://api.union.meituan.com/data/api?city=%e5%8c%97%e4%ba%ac\&limit=10\&key=xxxxx\&sort=1


Re-access on the normal output of the content.


Here is a solution to multiple parameters for get requests, about Curl POST request parameter questions can refer to this article:Curl website Development Guide





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.