我的身份验证工作正常,我什至在邮递员中测试了我的查询,原因是我似乎错过了我的查询返回
function generate_edge_curl(){
$endpoint = $this->get_endpoint();
$auth_token = $this->token->get_token();
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'x-amz-user-agent: aws-amplify/2.0.1',
'content-type: application/json',
'Authorization: '.$auth_token['access_token'],
));
return $ch;
}
function get_bidders(){
$ch = $this->generate_edge_curl();
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query":"{
auctionInfo(id: \'alldal\') {
bidders {
list {
companyAmsId
companyName
firstName
lastName
badgeNum
bidderType
}
}
}
}"}');
$output = curl_exec($ch);
curl_close($ch);
var_dump($output);
}
返回
string(133) "{
"errors" : [ {
"message" : "Invalid JSON payload in POST request.",
"errorType" : "MalformedHttpRequestException"
} ]
}"
我是图形 ql 的新手,我在这里缺少什么?