请问为什么调用user login和node创建这些应该是POST类型的接口时,不设置 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST'); 也能成功?
<?php
......
$node_data = array(
'title' => 'hhh',
'uid' => $logged_user->user->uid,
'type' => 'article'
);
$node_data = http_build_query($node_data);
$curl = curl_init($request_url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json', 'X-CSRF-Token: ' . $token));
curl_setopt($curl, CURLOPT_POSTFIELDS, $node_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIE, $cookie_session);
$response = curl_exec($curl);
......
?>