linux - 可以在 curl 配置文件中使用 GET 和 POST

标签 linux rest shell curl

我有一个调用命令的 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/

相关文章:

linux - 在 Linux Mint 16 上构建 QtD 失败

c# - 编写带有 URI 和 DataContract 类参数的 Web 服务方法

R Shiny 错误: could not find function "shell"

C 将字符串映射到函数

java - 如何在远程 Linux 上启动应用程序并等待响应

linux - Shell 用户提示 (Y/n)

linux 上的 java keylistener

java - 启动 jetty 服务器时出现 NoClassDefFoundError

java - 开发基于 REST 的客户端程序的必要组件和策略是什么?

java - 使用经过身份验证的 REST 服务的 Web 应用程序的登录实现