add CommonRequest.header
This commit is contained in:
@@ -34,6 +34,21 @@ public class CommonRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommonRequest header(String key, String value) {
|
||||
request.addHeader(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommonRequest token(String token) {
|
||||
request.addHeader("Token", token);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommonRequest language(String langHeader) {
|
||||
request.addHeader("Accept-Language", langHeader);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String asString() throws IOException {
|
||||
return request.execute().returnContent().asString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user