简体   繁体   中英

500 Internal Server Error with curl

I've run out of ideas of what might causes the 500 Internal Server Error with cURL

$someString = '7abcd684efg1hi085b7b47dc4e508e99a5edcba9';
$url = 'http://192.168.254.211:8080/sampleProject/auth/logout/'.$someString;
$logoutCurl = curl_init($url);
curl_setopt_array($logoutCurl, 
    array(
        CURLOPT_URL => $url,
        CURLOPT_POST => true,
        CURLOPT_HEADER => false,
        // CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTPHEADER => array(
            'Content-Type: application/json', 
            'jrr: '.$jrr, 
            'slave: '.$slave,
            'spoil: '.$spoil
        )
    )
);
curl_exec($logoutCurl);
curl_close($logoutCurl);

It keeps on giving me the Internal Server error, and it says that it doesn't actually call the server, but I'm sure I'm properly connected to the server as I can successfully login.

Some notes: $someString is a string added to the url as it is required by the server. $jrr , $slave , and $spoil are required to be pass. the server doesn't return or respond anything, I just need to get the 200 status. Is there something that I'm missing out on cURL?

thanks!

我删除了CURLOPT_POST => true因为我实际上没有将变量传递给页面,这就是为什么我认为curl_error给我400 Bad Request

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM