public class HttpRequest extends Object implements DataSource
Constructor and Description |
---|
HttpRequest(String uri)
通过要请求的URI构建请求对象 Construct the request object by the URI to be requested
|
Modifier and Type | Method and Description |
---|---|
String |
get()
获得GET请求的响应结果 Get the response result of GET request
|
int |
getStatusCode()
获得请求结果HTTP状态码 Get request result HTTP status code
|
String |
getStatusLine()
获得请求结果HTTP状态的字符串说明 Get the string description of the HTTP status of the request result
|
public HttpRequest(String uri)
uri
- 要请求的URI地址 URLpublic String getStatusLine()
getStatusLine
in interface DataSource
public int getStatusCode()
getStatusCode
in interface DataSource
public String get() throws Exception
get
in interface DataSource
Exception
- 异常 ExceptionCopyright © 2016–2021. All rights reserved.