有什么区别:
curl -v --data "username=username&password=password&sessionDataKey=5c4a5bb8-eb14-44a0-a745-50f54024a1b2" https://api.toonapi.com/commonauth/
和
$url = 'https://api.toonapi.com/commonauth/';
$session_key = $this->curlSessionKey();
$data_string = 'username=' . $username . '&password=' . $password . '&sessionDataKey=' . $session_key;
//json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded',
'Content-Length: ' . strlen($data_string))
);
我似乎无法弄清楚我做错了什么