如何使用 http 请求创建和启动 XL Release 版本?
How to create and start a XL Release release with a http request?
我需要帮助,因为我不擅长 HTTP 请求。
我正在尝试使用 HTTP 请求在我的 XL 发布服务器上创建一个发布。现在我正在使用 Curl 在批处理文件中进行处理,就像那样
curl "https://{ID}:{password}@{IP}:{port}/api/v1/templates/Applications/Folder{IDFolder}/create" -i -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d %0\..\ReleaseConfig.json
我调用的与脚本位于同一目录中的数据文件是这样的 json :
{ "releaseTitle" : "API Test", "releaseVariables" : { }, "releasePasswordVariables" : { }, "scheduledStartDate" : null, "autoStart" : false }
问题是,我在执行命令时遇到了这样的错误:
RESTEASY003065: Cannot consume content type
你知道什么可以帮助我的案子吗?
谢谢
通过查看您的文件名,您似乎在 Windows。我怀疑你不能用引号转义你的 Content-type ,你必须使用双引号。
此外,要将文件作为 POST 数据传递,您必须使用 @,如下所示:
curl "https://{ID}:{password}@{IP}:{port}/api/v1/templates/Applications/Folder{IDFolder}/create" -i -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d @%0\..\ReleaseConfig.json
我需要帮助,因为我不擅长 HTTP 请求。
我正在尝试使用 HTTP 请求在我的 XL 发布服务器上创建一个发布。现在我正在使用 Curl 在批处理文件中进行处理,就像那样
curl "https://{ID}:{password}@{IP}:{port}/api/v1/templates/Applications/Folder{IDFolder}/create" -i -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d %0\..\ReleaseConfig.json
我调用的与脚本位于同一目录中的数据文件是这样的 json :
{ "releaseTitle" : "API Test", "releaseVariables" : { }, "releasePasswordVariables" : { }, "scheduledStartDate" : null, "autoStart" : false }
问题是,我在执行命令时遇到了这样的错误:
RESTEASY003065: Cannot consume content type
你知道什么可以帮助我的案子吗?
谢谢
通过查看您的文件名,您似乎在 Windows。我怀疑你不能用引号转义你的 Content-type ,你必须使用双引号。 此外,要将文件作为 POST 数据传递,您必须使用 @,如下所示:
curl "https://{ID}:{password}@{IP}:{port}/api/v1/templates/Applications/Folder{IDFolder}/create" -i -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d @%0\..\ReleaseConfig.json