curl中直接添加&符号不认识问题

[yanfa@jumpserver01 ~]$ curl http://url:port/dtsres/result/getFailDetails?day=2019-05-28&state=0&type=2
[1] 27164
[2] 27165
[yanfa@jumpserver01 ~]$ {"state":500,"desc":"Required Integer parameter 'state' is not present"}
[1]-  Done                    curl http://url:port/dtsres/result/getFailDetails?day=2019-05-28
[2]+  Done                    state=0
[yanfa@jumpserver01 ~]$ 
[yanfa@jumpserver01 ~]$ curl http://url:port/dtsres/result/getFailDetails?day=2019-05-28\&state=0\&type=2

可以看到在控制台&符号被当做命令行指令运行了,添加转义即可.

 

 

你可能感兴趣的:(web)