Postman 从海康威视摄像机获取实时lpr结果

Postman 从海康威视摄像机获取实时lpr结果,postman,Postman,我想从海康威视LPR摄像机获取实时LPR结果。我有来自海康威视ISAPI文档的链接:/ISAPI/Traffic/channels/1/vehicleDetect/plates 我得到以下错误: <?xml version="1.0" encoding="UTF-8"?> <ResponseStatus version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema"> <requestURL>/

我想从海康威视LPR摄像机获取实时LPR结果。我有来自海康威视ISAPI文档的链接:/ISAPI/Traffic/channels/1/vehicleDetect/plates

我得到以下错误:

<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema">
    <requestURL>/ISAPI/Traffic/channels/1/vehicleDetect/plates</requestURL>
    <statusCode>6</statusCode>
    <statusString>Invalid XML Content</statusString>
    <subStatusCode>badXmlContent</subStatusCode>
</ResponseStatus>

/ISAPI/交通/通道/1/车辆检测/车牌
6.
无效的XML内容
badXmlContent
此链接不工作,而/ISAPI/Traffic/channels/1/vehicleDetect/work链接工作。请帮助我解决此问题。

无效的XML内容

HTTP内容“0”<抓取最后20个板块

HTTP方法是“POST”!!!不获取文档是错误的,获取从不向服务器发送任何数据;),这就是为什么在输入时会得到无效的xml格式

无效的xml内容

HTTP内容“0”<抓取最后20个板块

HTTP方法是“POST”!!!不获取文档是错误的,获取从不向服务器发送任何数据;),这就是在输入时得到无效xml格式的原因

有效:

$username = 'xxxxx';
$password = 'yyyyy';

$url = "https://xxx.xxx.xxx.xxx/ISAPI/Traffic/channels/1/vehicleDetect/plates";



$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch,CURLOPT_TIMEOUT, 30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<AfterTime version=\"2.0\"><picTime>2020-06-20T00:00:00Z</picTime></AfterTime>"); 
$first_response = curl_exec($ch);
$info = curl_getinfo($ch);

preg_match('/WWW-Authenticate: Digest (.*)/', $first_response, $matches);

if(!empty($matches))
{
  $auth_header = $matches[1];
  $auth_header_array = explode(',', $auth_header);
  $parsed = array();

  foreach ($auth_header_array as $pair)
  {
    $vals = explode('=', $pair);
    $parsed[trim($vals[0])] = trim($vals[1], '" ');
  }

  $response_realm     = (isset($parsed['realm'])) ? $parsed['realm'] : "";
  $response_nonce     = (isset($parsed['nonce'])) ? $parsed['nonce'] : "";
  $response_opaque    = (isset($parsed['opaque'])) ? $parsed['opaque'] : "";

  $authenticate1 = md5($username.":".$response_realm.":".$password);
  $authenticate2 = md5("POST:".$url);

  $authenticate_response = md5($authenticate1.":".$response_nonce.":".$authenticate2);

  $request = sprintf('Authorization: Digest username="%s", realm="%s", nonce="%s", opaque="%s", uri="%s", response="%s"',
  $username, $response_realm, $response_nonce, $response_opaque, $url, $authenticate_response);

  $request_header = array($request);
  $request_header[] = 'Content-Type:application/json';

  $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL, $url);
  curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch,CURLOPT_FOLLOWLOCATION, false);
  curl_setopt($ch,CURLOPT_TIMEOUT, 30);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, "<AfterTime version=\"2.0\"><picTime>2020-06-20T00:00:00Z</picTime></AfterTime>"); 
  curl_setopt($ch, CURLOPT_HTTPHEADER, $request_header);

  $result['response']= curl_exec($ch);
  
 print_r($result['response']);

}
$username='xxxxx';
$password='yyyyy';
$url=”https://xxx.xxx.xxx.xxx/ISAPI/Traffic/channels/1/vehicleDetect/plates";
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,false);
curl_setopt($ch,CURLOPT_超时,30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,“POST”);
curl_setopt($ch,CURLOPT_头,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,“2020-06-20T00:00:00Z”);
$first\u response=curl\u exec($ch);
$info=curl\u getinfo($ch);
preg_match('/WWW-Authenticate:Digest(.*)/',$first_response,$matches);
如果(!空($matches))
{
$auth_header=$matches[1];
$auth_header_数组=分解(',',$auth_header);
$parsed=array();
foreach($auth\u header\u数组作为$pair)
{
$VAL=分解('=',$pair);
$parsed[trim($vals[0])]=trim($vals[1],“”);
}
$response_realm=(isset($parsed['realm'])?$parsed['realm']:“”;
$response_nonce=(isset($parsed['nonce'])?$parsed['nonce']:“”;
$response_opaque=(isset($parsed['opaque'])?$parsed['opaque']:“”;
$authenticate1=md5($username.:“$response\u realm.:”$password);
$authenticate2=md5(“POST:.$url”);
$authenticate\u response=md5($authenticate1.”:“$response\u nonce.”:“$authenticate2);
$request=sprintf('Authorization:Digest username=“%s”、realm=“%s”、nonce=“%s”、不透明=“%s”、uri=“%s”、response=“%s””,
$username、$response\u realm、$response\u nonce、$response\u不透明、$url、$authenticate\u response);
$request_header=数组($request);
$request_header[]='内容类型:application/json';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,false);
curl_setopt($ch,CURLOPT_超时,30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,“POST”);
curl_setopt($ch,CURLOPT_POSTFIELDS,“2020-06-20T00:00:00Z”);
curl_setopt($ch,CURLOPT_HTTPHEADER,$request_header);
$result['response']=curl_exec($ch);
打印($result['response']);
}
有效:

$username = 'xxxxx';
$password = 'yyyyy';

$url = "https://xxx.xxx.xxx.xxx/ISAPI/Traffic/channels/1/vehicleDetect/plates";



$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch,CURLOPT_TIMEOUT, 30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<AfterTime version=\"2.0\"><picTime>2020-06-20T00:00:00Z</picTime></AfterTime>"); 
$first_response = curl_exec($ch);
$info = curl_getinfo($ch);

preg_match('/WWW-Authenticate: Digest (.*)/', $first_response, $matches);

if(!empty($matches))
{
  $auth_header = $matches[1];
  $auth_header_array = explode(',', $auth_header);
  $parsed = array();

  foreach ($auth_header_array as $pair)
  {
    $vals = explode('=', $pair);
    $parsed[trim($vals[0])] = trim($vals[1], '" ');
  }

  $response_realm     = (isset($parsed['realm'])) ? $parsed['realm'] : "";
  $response_nonce     = (isset($parsed['nonce'])) ? $parsed['nonce'] : "";
  $response_opaque    = (isset($parsed['opaque'])) ? $parsed['opaque'] : "";

  $authenticate1 = md5($username.":".$response_realm.":".$password);
  $authenticate2 = md5("POST:".$url);

  $authenticate_response = md5($authenticate1.":".$response_nonce.":".$authenticate2);

  $request = sprintf('Authorization: Digest username="%s", realm="%s", nonce="%s", opaque="%s", uri="%s", response="%s"',
  $username, $response_realm, $response_nonce, $response_opaque, $url, $authenticate_response);

  $request_header = array($request);
  $request_header[] = 'Content-Type:application/json';

  $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL, $url);
  curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch,CURLOPT_FOLLOWLOCATION, false);
  curl_setopt($ch,CURLOPT_TIMEOUT, 30);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, "<AfterTime version=\"2.0\"><picTime>2020-06-20T00:00:00Z</picTime></AfterTime>"); 
  curl_setopt($ch, CURLOPT_HTTPHEADER, $request_header);

  $result['response']= curl_exec($ch);
  
 print_r($result['response']);

}
$username='xxxxx';
$password='yyyyy';
$url=”https://xxx.xxx.xxx.xxx/ISAPI/Traffic/channels/1/vehicleDetect/plates";
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,false);
curl_setopt($ch,CURLOPT_超时,30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,“POST”);
curl_setopt($ch,CURLOPT_头,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,“2020-06-20T00:00:00Z”);
$first\u response=curl\u exec($ch);
$info=curl\u getinfo($ch);
preg_match('/WWW-Authenticate:Digest(.*)/',$first_response,$matches);
如果(!空($matches))
{
$auth_header=$matches[1];
$auth_header_数组=分解(',',$auth_header);
$parsed=array();
foreach($auth\u header\u数组作为$pair)
{
$VAL=分解('=',$pair);
$parsed[trim($vals[0])]=trim($vals[1],“”);
}
$response_realm=(isset($parsed['realm'])?$parsed['realm']:“”;
$response_nonce=(isset($parsed['nonce'])?$parsed['nonce']:“”;
$response_opaque=(isset($parsed['opaque'])?$parsed['opaque']:“”;
$authenticate1=md5($username.:“$response\u realm.:”$password);
$authenticate2=md5(“POST:.$url”);
$authenticate\u response=md5($authenticate1.”:“$response\u nonce.”:“$authenticate2);
$request=sprintf('Authorization:Digest username=“%s”、realm=“%s”、nonce=“%s”、不透明=“%s”、uri=“%s”、response=“%s””,
$username、$response\u realm、$response\u nonce、$response\u不透明、$url、$authenticate\u response);
$request_header=数组($request);
$request_header[]='内容类型:application/json';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,false);
curl_setopt($ch,CURLOPT_超时,30);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,“POST”);
curl_setopt($ch,CURLOPT_POSTFIELDS,“2020-06-20T00:00:00Z”);
curl_setopt($ch,CURLOPT_HTTPHEADER,$request_header);
$result['response']=curl_exec($ch);
打印($result['response']);
}

extime picTime 0/picTime/extime<只需添加<和>^ extime picTime 0/picTime/extime<只需添加<和>^^