IP address query interface
Using system. text;
Using system;
Using system. net;
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?