Este:
- Code: Select all Expand view RUN
- <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://treinamento.atende.net/atende.php?pg=rest&service=WNERestServiceNFSe&cidade=migra_pinhais',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('XML'=> new CURLFILE('/H:/NFSe/S_NS9_000000003-nfSe.xml')),
CURLOPT_HTTPHEADER => array(
'Authorization: Basic MDkyNDczNDMwMDAxMjA6SXBtQDIwMjE='
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
ou este:
- Code: Select all Expand view RUN
- POST /atende.php?pg=rest&service=WNERestServiceNFSe&cidade=migra_pinhais HTTP/1.1
Host: treinamento.atende.net
Authorization: Basic MDkyNDczNDMwMDAxMjA6SXBtQDIwMjE=
Content-Length: 196
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="XML"; filename="/H:/NFSe/S_NS9_000000003-nfSe.xml"
Content-Type: text/xml
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
Mui grato...