IP address query interface
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 IP
{
Class Program
{
Static void main (string [] ARGs)
{
String key = "************************";
String IP = "168.183.151.112 ";
String url = "http://apis.haoservice.com/lifeservice/queryIpAddr? IP = "+ IP +" & Key = "+ key;
WebClient WC = new WebClient ();
WC. Encoding = encoding. utf8;
String STR = WC. downloadstring (URL );
Console. writeline (STR );
Console. readkey ();
}
}
}
Interface Information
URL: http://apis.haoservice.com/lifeservice/queryIpAddr
Supported format: JSON
HTTP Request Method: Get
Demo: http://apis.haoservice.com/lifeservice/queryIpAddr? IP = 115.183.152.152 & Key = The appkey you applied
Returned results:
{
"Error_code": 0,
"Reason": "success ",
"Result ":
{
"Area": "Beijing ",
"Location": ""
}
}
IP address query interface