Created
April 16, 2018 09:50
-
-
Save cosminpopescu14/de0d71023996e5841b88b0c9c7a3e842 to your computer and use it in GitHub Desktop.
Querying Anaf WS with php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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