简体   繁体   中英

How to pass post param value with & included using curl

I am trying to make a curl request with post parameters. Below is the curl request:

curl -d "name=abcdef&ghi&age=20" <http://f1.com>

The name parameter value contains & character and it is acting as a delimiter. Is there any way to include & in the parameter values??

To use an an Ampersand symbol (&) in a URL it must have the proper encoding (%26).

Replace the & in the name parameter with %26 in your URL and you should be fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM