Unix 在curl中的get request中发送多个请求参数,只执行单个参数
我试图通过命令行向我的api发出curl-get请求Unix 在curl中的get request中发送多个请求参数,只执行单个参数,unix,curl,get,Unix,Curl,Get,我试图通过命令行向我的api发出curl-get请求 curl http://localhost:8080/getList?id=100&mrp=50&discount=0 但当我在api中记录请求时,我得到: &{GET /getList?id=100 HTTP/1.1 1 1 which means that only id is being sent through the request. I don't understand why it is happen
curl http://localhost:8080/getList?id=100&mrp=50&discount=0
但当我在api中记录请求时,我得到:
&{GET /getList?id=100 HTTP/1.1 1 1 which means that only id is being sent through the request. I don't understand why it is happening.
当您使用由
&
分隔的多个请求参数运行curl命令时,unix将&
视为在后台执行上一个命令的符号。它后面的所有内容都将被视为单独的命令
发送请求时将url包装在引号中
curl "http://localhost:8080/getList?id=100&mrp=50&discount=0"
复制/粘贴url时没有查看鼠标下方,这是一个愚蠢的错误。