问题描述
我需要帮助,因为我对HTTP请求不满意。
我正在尝试通过HTTP请求在XL Release服务器上创建Release。现在,我正在像这样的批处理文件中使用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数据传递,您必须使用@,如下所示:
notifSchedule = (todo,date) => {
PushNotification.localNotificationSchedule({
id: todo.id,message: todo.title,date: date,allowWhileIdle: true,priority: 'high',});
};