public final class HttpUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
HttpUtils.IProcessInputStream
This interface should be implemented by the http response body stream processor.
|
Modifier and Type | Method and Description |
---|---|
static String |
get(String url,
Integer timeout)
Uses the get method to send a url with arguments by http, this method can call RESTful Api.
|
static void |
get(String url,
Integer timeout,
HttpUtils.IProcessInputStream processInputStream)
Uses the get method to send a url with arguments by http, this method can call RESTful Api.
|
static InputStream |
getInputStream(String url,
Integer timeout)
Uses the get method to send a url with arguments by http, this method can call RESTful Api.
|
static org.apache.http.Header[] |
head(String url,
Integer timeout)
Uses the head method to send a url with arguments by http, this method can call RESTful Api.
|
static String |
post(String url,
Integer timeout)
Uses the post method to send a url with arguments by http, this method can call RESTful Api.
|
static void |
post(String url,
String cookies,
Integer timeout,
HttpUtils.IProcessInputStream processInputStream)
Uses the post method to send a url with arguments by http, this method can call RESTful Api.
|
public static void post(String url, String cookies, Integer timeout, HttpUtils.IProcessInputStream processInputStream) throws IOException
url
- the http urlcookies
- the cookies to use in the requesttimeout
- milliseconds to wait for the server to respond before giving upprocessInputStream
- the response body stream processorIOException
public static String post(String url, Integer timeout) throws IOException
url
- the http urltimeout
- milliseconds to wait for the server to respond before giving upIOException
public static InputStream getInputStream(String url, Integer timeout) throws IOException
url
- the http urltimeout
- milliseconds to wait for the server to respond before giving upIOException
public static void get(String url, Integer timeout, HttpUtils.IProcessInputStream processInputStream) throws IOException
url
- the http urltimeout
- milliseconds to wait for the server to respond before giving upprocessInputStream
- the response body stream processorIOException
public static String get(String url, Integer timeout) throws IOException
url
- the http urltimeout
- milliseconds to wait for the server to respond before giving upIOException
public static org.apache.http.Header[] head(String url, Integer timeout)
url
- the http urltimeout
- milliseconds to wait for the server to respond before giving upCopyright © 2023. All Rights Reserved.