gpt4 book ai didi

javascript - 消息“:"There was an error processing the request.","StackTrace":"","ExceptionType"- JQUERY

转载 作者:行者123 更新时间:2023-11-28 04:36:47 32 4
gpt4 key购买 nike

这是我的代码,我不断收到相同的错误响应。

"{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}"

我想不通。我正在使用 Eloqua API 来获取基本信息,例如帐户总数、登陆页面、用户、图像等。这很奇怪,因为我在 POSTMAN 应用程序上尝试了该 API,它确实工作得很好 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
}

控制台 console.log response (click for image)

最佳答案

尝试将网址 http://secure.p03.eloqua.com/API/REST/1.0/ 更改为 https

关于javascript - 消息“:"There was an error processing the request.","StackTrace":"","ExceptionType"- JQUERY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44139524/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com