Skip to content

Instantly share code, notes, and snippets.

@cosminpopescu14
Created April 16, 2018 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosminpopescu14/de0d71023996e5841b88b0c9c7a3e842 to your computer and use it in GitHub Desktop.
Save cosminpopescu14/de0d71023996e5841b88b0c9c7a3e842 to your computer and use it in GitHub Desktop.
Querying Anaf WS with php
<?php
$anafEndpoint = "https://webservicesp.anaf.ro/PlatitorTvaRest/api/v3/ws/tva";
$data = '[{"cui":"", "data":"2018-04-16"}]';
$curl_option = [
CURLOPT_URL => $anafEndpoint,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
CURLOPT_SSL_VERIFYPEER => false
];
$ch = curl_init();
curl_setopt_array($ch, $curl_option);
$result = curl_exec($ch);
if (!$result) {
echo sprintf("Curl error: %s", curl_error($ch));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment