Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parse platform 来自Javascript的REST API-无效的HTTP状态代码405_Parse Platform - Fatal编程技术网

Parse platform 来自Javascript的REST API-无效的HTTP状态代码405

Parse platform 来自Javascript的REST API-无效的HTTP状态代码405,parse-platform,Parse Platform,新的解析开发人员在这里寻找一些帮助 我试图从我的应用程序调用REST API来记录自定义分析,但由于某些原因,我正在进行的XMLHttpRequest失败,并显示错误消息: XMLHttpRequest cannot load https://api.parse.com/1/events/marker. Invalid HTTP status code 405 以下是我用于发出请求的代码: xmlhttp.open("POST", "https://api.parse.com/1/event

新的解析开发人员在这里寻找一些帮助

我试图从我的应用程序调用REST API来记录自定义分析,但由于某些原因,我正在进行的XMLHttpRequest失败,并显示错误消息:

XMLHttpRequest cannot load https://api.parse.com/1/events/marker. Invalid HTTP status code 405 
以下是我用于发出请求的代码:

xmlhttp.open("POST", "https://api.parse.com/1/events/marker", true);
xmlhttp.setRequestHeader("X-Parse-Application-Id","appidhere");
xmlhttp.setRequestHeader("X-Parse-REST-API-Key","apikeyhere");
xmlhttp.setRequestHeader("Content-Type","application/json");
xmlhttp.send('{"dimensions":{"action":"showDetails"}}');
这是控制台输出:

OPTIONS https://api.parse.com/1/events/marker  (index):3639(anonymous function) (index):3639S.trigger main.js:15(anonymous function) VM625:31(anonymous function) VM623:11S.trigger main.js:15L.zc VM622:132L.nn VM622:132(anonymous function) main.js:13S.trigger main.js:15L.kl VM622:116(anonymous function) main.js:16
XMLHttpRequest cannot load https://api.parse.com/1/events/marker. Invalid HTTP status code 405` 
但最奇怪的是,当我使用文档中的curl示例发出请求时,它工作得非常好。:/知道我做错了什么吗?希望这是我忽略的简单的事情。谢谢

出现HTTP 405错误。您试图访问的资源不接受POST方法

确保您试图访问的资源支持POST;如果没有,则必须相应地更改XMLHttpRequest