消息":“处理请求时出错.","StackTrace":“","ExceptionType". -JQUERY [英] Message":"There was an error processing the request.","StackTrace":"","ExceptionType" - JQUERY
本文介绍了消息":“处理请求时出错.","StackTrace":“","ExceptionType". -JQUERY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码,我不断收到相同的错误响应.
Here is my code, I keep on getting the same error response.
"{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}"
我不知道.我正在使用Eloqua API来获取基本信息,例如帐户总数,登录页面,用户,图像等.这很奇怪,因为我在POSTMAN应用程序上尝试了该API,并且效果很好
I can't figure it out. I'm using Eloqua APIs to get basic information such as total number of accounts, landing pages, users, images, etc. It's weird because I tried the API on POSTMAN application and it did work perfectly Screenshot of postman response to the API
PHP
$objetos = array("data/accounts", "data/contacts", "assets/emails", "assets/landingPages", "assets/images", "assets/forms", "system/users", "assets/microsites", "assets/customObjects");
for ($i = 0; $i < 9; $i++){
$url = 'http://secure.p03.eloqua.com/API/REST/1.0/' . $objetos[$i] . '?count=1';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
$headers = array(
'Content-type: application/json',
'Authorization: BASIC "MY TOKEN"'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() ."/EloquaApi_lvl1.cer");
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
$data[$i] = curl_exec($ch);
curl_close($ch);
}
echo json_encode($data);
?>
JS
function getObjetos(){
$.get("objetos.php", function (data) {
console.log(data);
}, "json").done(function (data) {
console.log(data);
// rest of my code
}
推荐答案
尝试将URL http://secure.p03.eloqua.com/API/REST/1.0/
更改为https
Try changing the url http://secure.p03.eloqua.com/API/REST/1.0/
to https
这篇关于消息":“处理请求时出错.","StackTrace":“","ExceptionType". -JQUERY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文