扩展cURL最大URL长度或其他选项?

4 php curl

我用cURL发送一个相当长的URL,我几乎肯定是cURL处理的时间太长了.URL http://hiscore.runescape.com/index_lite.ws?player=?player=参数之后,最多可以有12个数字/字母/符号.

是否有替代cURL可以支持这样的长URL,或者我可以以某种方式使用cURL和那么长的URL吗?

Raf*_*ler 5

libcurl或PHP cURL的URL长度没有限制.所以这不是问题.

是什么让你相信有尺寸限制?

  • 他只是害怕卷曲的力量;-) (2认同)

小智 1

符号可能是使用类似的东西的可能原因

网址编码

Base64 编码

function getStats($username) { echo $username // 查看用户名是否被发送到此函数

只需独立运行此代码即可查看它是否有效

function getStats($username) {
    $ch = curl_init();
    $data = array('player' => '$username');
    curl_setopt($ch, CURLOPT_URL, 'http://hiscore.runescape.com/index_lite.ws');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_exec($ch);
}

getStats('what_ever_username');
Run Code Online (Sandbox Code Playgroud)