Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复一些规范上的错误 #131

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
feat:增加HttpClientUtil工具类
  • Loading branch information
chenhaipeng committed Oct 5, 2018
commit bcfa5be3aa43cade6f93cbead97c609272ada4e6
16 changes: 16 additions & 0 deletions vjkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<junit.version>4.12</junit.version>
<assertj.version>2.6.0</assertj.version>
<mockito.version>2.18.3</mockito.version>
<httpclient.version>4.5.6</httpclient.version>


<!-- Plugin的属性 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -41,6 +43,20 @@
<version>${commons-lang3.version}</version>
</dependency>

<!-- apache httpclient组件 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/fluent-hc -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>${httpclient.version}</version>
</dependency>


<!-- Log -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.vip.vjtools.vjkit.net;

import java.io.Serializable;

/**
* 封装httpClient响应结果
*/
public class HttpClientResult implements Serializable {

private static final long serialVersionUID = 2168152194164783950L;

/**
* 响应状态码
*/
private int code;

/**
* 响应数据
*/
private String content;

public HttpClientResult() {
}

public HttpClientResult(int code) {
this.code = code;
}

public HttpClientResult(String content) {
this.content = content;
}

public HttpClientResult(int code, String content) {
this.code = code;
this.content = content;
}

public int getCode() {
return code;
}

public void setCode(int code) {
this.code = code;
}

public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content;
}

@Override
public String toString() {
return "HttpClientResult [code=" + code + ", content=" + content + "]";
}

}
Loading