I am trying to make a bot for: https://coinroll.it/api
From the website:
The Coinroll API is a stateless interface that works through HTTPS. Requests are made using POST variables (application / x-www-form-urlencoded), while responses are encoded in JSON (application / json). Access to the API requires an HTTPS connection.
I have the following code:
$ch = curl_init(); $data = array('user' => 'xxx', 'password' => 'yyy'); curl_setopt($ch, CURLOPT_URL, 'https://coinroll.it'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); echo $result;
When I run this code, it returns a blank page, what am I doing wrong?
EDIT
I really don't need to use cURl, if there is a better solution, please tell me.
user2536244
source share