获取市及以上行政区划数据
简介:需要为移动端提供市及以上区域字典信息,采取httpclient的方式访问第三方的数据接口获取解析。
环境配置
- jdk1.8
- idea2016.2.4
- Maven3.3.9
第三方架包
创建配置maven quick-start项目
新建maven工程,选择quick-start

配置GroupId和Artifactd

设置maven属性(如果有maven环境默认即可)

设置工程目录

配置项目属性
添加httpClient依赖
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.1</version>
</dependency>
添加fastJson依赖
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<<