gpt4 book ai didi

PHP CURL 发布请求和错误 417

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:01:56 25 4
gpt4 key购买 nike

function query($url, $pfields = 0, $cookie = 0)
{
curl_setopt($ch, CURLOPT_HEADER, 1);
if (!empty($pfields))
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $pfields);
}
if (!empty($cookie))
{
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING,'gzip');
if (!$login)
{
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
}
$content = curl_exec($ch);
return $content;
}

$cookie = 'sessionID=3864cab58412ec567b634db3c317898;OAGEO=RU%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C;';
$p = '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++';
$post = 'clientid=23&campaignid=52&bannerid=111&appendsave=1&appendtype=0&append=' . urlencode($p) . '&submitbutton=';

echo query('http://example.com/in.php', $post, $cookie);

此代码返回 417 错误(但是 $p 不是使用 urlencode 但可以,但是 +(plus) 更改为 ""(space)

对不起,我的英语很烂

最佳答案

尝试添加这个:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

关于PHP CURL 发布请求和错误 417,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3755786/

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