我有一个调用该命令的shell脚本:curl -K config_file.cfg。
但是,GET使用紧身衣裤,这会导致错误
config_file.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"}
答案 0 :(得分:0)
您可以使用配置文件中的request
选项指定请求方法。
#URL du WS
#Definition des header
header="Content-Type:application/json"
header="Authorization:Basic UFNTOlNTTyNQU1M="
url=http://bonjour:15555/rappels/00077778
request=get
output=/data/exploit/tmp/liste_00077778.txt
url=http://bonjour:15555/rappels/add
request=post
output=/data/exploit/tmp/add_16011401.txt
data=@/home/IAB_TEST/query_post_body/add_16011401.json
答案 1 :(得分:0)
在请求之间插入--next
,此标志将重置所有本地参数。