1
I am trying to recover the data from an API on the server using CURL, however it seems that 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 data","status":false}