I'm trying to retrieve data from an API on the server using CURL, however, it looks like POST data is not going
<?php
$postfields = array(
'login' => 'login',
'senha' => 'senha'
);
// página que receberá a requisição post
$pagina = 'http://apps.meusapps.m/api';
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $pagina );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $postfields );
curl_exec( $ch );
curl_close();
Return:
{"message": "You need to provide login and password", "status": false}