【发布时间】:2021-04-22 02:12:19
【问题描述】:
我们最近切换到了一个新服务器,现在突然间我收到了 mailchimp 发送活动端点的错误。
活动创建没有问题,但它只是发送返回以下错误。关于可能导致此问题的任何想法?
<HTML><HEAD>
<TITLE>Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Reference #7.640be8ac.1610827794.1757979e
</BODY>
</HTML>
下面是我的 PHP 代码
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$this->oauthData['oauth_api_endpoint'].'.api.mailchimp.com/3.0/campaigns/'.$campaignID.'/actions/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Accept: application/vnd.api+json',
'Content-Type: application/vnd.api+json',
'Authorization: OAuth ' . $this->oauthData['oauth_token']
));
curl_setopt($ch, CURLOPT_USERAGENT, $cuseragnet);
$result = curl_exec($ch);
【问题讨论】:
标签: php curl mailchimp mailchimp-api-v3.0