Vehicle violation query demo
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. text;
Using system. net. Security;
Using system. Security. cryptography. x509certificates;
Using system. net;
Using system. IO;
Using system. Io. compression;
Using system. Text. regularexpressions;
Using system. Web. Script. serialization;
Namespace weizhang
{
Class Program
{
Static void main (string [] ARGs)
{
String city = "********"; // city code *
String hphm = "**********"; // a complete 7-digit number *
String hpzl = "02"; // Number of the plate type (refer to the plate type interface )*
String engineno = "*******"; // engine number (based on parameters in the city Interface)
String key = "**********************"; // applied key value
String url = "http://apis.haoservice.com/weizhang/query? City = "+ city +" & hphm = "+ hphm +" & hpzl = "+ hpzl +" & engineno = "+ engineno +" & Key = "+ key;
WebClient WC = new WebClient ();
WC. Encoding = encoding. utf8;
String STR = WC. downloadstring (URL );
Console. writeline (STR );
Console. readkey ();
}
}
}
URL: http://apis.haoservice.com/weizhang/query
Supported format: JSON
HTTP Request Method: Get post
Demo: http://apis.haoservice.com/weizhang/query? City = ******** & hphm = ********* & hpzl = 02 & engineno = **
Return example:
{
"Error_code": "0 ",
"Reason": "successful return ",
"Result ":
{
"Province ":"*****",
"City ":"**********",
"Hphm ":"*********",
"Hpzl": "02 ",
"Lists ":
[
{
"Date ",
"Area": "wenyuan Street south ",
"Act": "If a motor vehicle other than a medium-sized or higher passenger-carrying vehicle or hazardous goods transport vehicle is driving more than 20% times per hour ",
"Code": "1352 ",
"Fen": "3 ",
"Currency": "200 ",
"Handled": "unprocessed ",
"Payno": "067900104603 ",
"Longpolling": "112.737809 ",
"Latitude": "37.710136"
}
]
}
}
Note:
For a vehicle violation query, you must first have a key value, and then enter the city code, number plate number, and number of the number plate type you want to query in sequence;
If an error occurs, view the code table on this web page (http://www.haoservice.com/docs/2/query.
Vehicle violation query demo