$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http:<url>:8082/api/users");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name": "test3","email":"test3@asdf.com","password": "test3"}');
$response=curl_exec($ch);
curl_close($ch);
please help, what did I do wrong?
:(
How do you do authorization?
Sorry, just forgot to add this
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
all good now :)
Thanks @Anton
please help, what did I do wrong?
:(