Package com.bluersw.source
Class HttpRequest
java.lang.Object
com.bluersw.source.HttpRequest
- All Implemented Interfaces:
DataSource
通过HTTP和HTTPS协议获得响应结果 Get response results through HTTP and HTTPS protocols
- Author:
- sunweisheng
-
Constructor Summary
ConstructorsConstructorDescriptionHttpRequest(String uri) 通过要请求的URI构建请求对象 Construct the request object by the URI to be requested -
Method Summary
Modifier and TypeMethodDescriptionget()获得GET请求的响应结果 Get the response result of GET requestint获得请求结果HTTP状态码 Get request result HTTP status code获得请求结果HTTP状态的字符串说明 Get the string description of the HTTP status of the request result
-
Constructor Details
-
HttpRequest
通过要请求的URI构建请求对象 Construct the request object by the URI to be requested- Parameters:
uri- 要请求的URI地址 URL
-
-
Method Details
-
getStatusLine
获得请求结果HTTP状态的字符串说明 Get the string description of the HTTP status of the request result- Specified by:
getStatusLinein interfaceDataSource- Returns:
- HTTP状态的字符串说明 String description of HTTP status
-
getStatusCode
public int getStatusCode()获得请求结果HTTP状态码 Get request result HTTP status code- Specified by:
getStatusCodein interfaceDataSource- Returns:
- HTTP状态码 HTTP status code
-
get
获得GET请求的响应结果 Get the response result of GET request- Specified by:
getin interfaceDataSource- Returns:
- 响应结果 Response results
- Throws:
Exception- 异常 Exception
-