简体   繁体   中英

Curl POST not sending data

I am trying to connect to an echosign api which used to work and now has suddenly stop working, I have tried debugging but can't seem to resolve it, this is my code

  public function get_access_token_get()
  {
    $echoSign = new EchoSign();

    $ch = curl_init('https://secure.echosign.com:443/api/rest/v2/auth/tokens');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($echoSign->echosign_creds));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

    $result = json_decode(curl_exec($ch));

    curl_close($ch);

    echo "<pre>"; print_r($result); echo "</pre>"; exit();

    return $result->accessToken;
  }

我已经使用其他URL测试了您的curl代码,并且对它们工作正常,然后我尝试使用其他curl方法调用您的URL,它给出了空响应,因此,我相信您应该向echosign支持进行检查,看看有什么问题。

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