ЮП
Size: a a a
ЮП
ЮП
E
E
E
IB
ЕК
<?php?>
$url = "https://api.server.ru:22301/some/api/method";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);;
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array();
$headers["Authorization"] = "Basic YWRtaWHMzl2Yzc=";
$headers["Content-Type"] = "application/json";
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = <<<DATA
{"devices":[
{"device_id": 28662}
]
}
DATA;
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
import requests
response = requests.post('https://api.server.ru:22301/some/api/method', data={'devices':[{'device_id': 28662}]}, headers={'Authorization': 'Basic YWRtaWHMzl2Yzc=', 'Content-Type': 'application/json'})
answer = response.json()
ЮП
E
import requests
response = requests.post('https://api.server.ru:22301/some/api/method', data={'devices':[{'device_id': 28662}]}, headers={'Authorization': 'Basic YWRtaWHMzl2Yzc=', 'Content-Type': 'application/json'})
answer = response.json()
E
import requests
response = requests.post('https://api.server.ru:22301/some/api/method', data={'devices':[{'device_id': 28662}]}, headers={'Authorization': 'Basic YWRtaWHMzl2Yzc=', 'Content-Type': 'application/json'})
answer = response.json()
ЕК
IB
E
ЕК
ЕК
import requests(
response = requests.post('https://api.server.ru:22301/some/api/method', data={'devices':[{'device_id': 28662}]}, headers={'Authorization': 'Basic YWRtaWHMzl2Yzc=', 'Content-Type': 'application/json'})
response.headers)
E
import requests(
response = requests.post('https://api.server.ru:22301/some/api/method', data={'devices':[{'device_id': 28662}]}, headers={'Authorization': 'Basic YWRtaWHMzl2Yzc=', 'Content-Type': 'application/json'})
response.headers)
ЕК
E
E
E