gpt4 book ai didi

unix - 在curl的get请求中发送多个请求参数,只有一个参数会

转载 作者:行者123 更新时间:2023-12-02 08:14:20 27 4
gpt4 key购买 nike

我正在尝试通过命令行向我的 api 发出 curl 获取请求。

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"

关于unix - 在curl的get请求中发送多个请求参数,只有一个参数会,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43376874/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com