Skip to content

Commit

Permalink
HttpRequest增加getReferer()
Browse files Browse the repository at this point in the history
  • Loading branch information
tywo45 committed Jan 20, 2019
1 parent ecc4062 commit 68b2234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/utils/src/main/java/org/tio/utils/http/HttpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,5 @@ public static Response post(String url) throws Exception {
}


public static void main(String[] args) throws Exception {
String url = "https://www.t-io.org/api/app/conf.php";
Response response = get(url);
String body = response.body().string();
Headers headers = response.headers();
String cookie = headers.get("Set-Cookie");
System.out.println(body);
System.out.println(cookie);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ public String getConnection() {
public void setConnection(String connection) {
this.connection = connection;
}

public String getReferer() {
return getHeader(HttpConst.RequestHeaderKey.Referer);
}

public boolean isNeedForward() {
return needForward;
Expand Down

0 comments on commit 68b2234

Please sign in to comment.