我有一个调用命令的 shell 脚本:curl -K config_file.cfg。
但是,GET 使用紧身衣裤,这会导致错误
配置文件.cfg:
#URL du WS
#Definition des header
header="Content-Type:application/json"
header="Authorization:Basic UFNTOlNTTyNQU1M="
url=http://bonjour:15555/rappels/00077778
output=/data/exploit/tmp/liste_00077778.txt
url=http://bonjour:15555/rappels/add
output=/data/exploit/tmp/add_16011401.txt
data=@/home/IAB_TEST/query_post_body/add_16011401.json
curl -K config_file.cfg
{"timestamp":1561631007821,"status":405,"error":"Method Not Allowed","exception":"org.springframework.web.HttpRequestMethodNotSupportedException","message":"Request method 'POST' not supported","path":"/rappels/00077778"}
最佳答案
在请求之间插入 --next
,此标志重置所有本地参数。
关于linux - 可以在 curl 配置文件中使用 GET 和 POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56788995/