com.hikvision.artemis.sdk.util

## 类 HttpUtil

- java.lang.Object
- - com.hikvision.artemis.sdk.util.HttpUtil

    public class HttpUtil
    extends Object

Http工具类

### 构造器概要

构造器
构造器和说明
`HttpUtil()`

### 方法概要

所有方法 静态方法 具体方法
`static Response` `httpDelete(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP DELETE
`static Response` `httpFilePost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, Map<String,Object> bodys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP POST 文件上传
`static Response` `httpGet(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP GET
`static Response` `httpImgGet(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, List<String> signHeaderPrefixList, String appKey, String appSecret)`
`static Response` `httpImgPost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, Map<String,String> bodys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP POST表单
`static Response` `httpImgPost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, String body, List<String> signHeaderPrefixList, String appKey, String appSecret)` Http POST 字符
`static Response` `httpPost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, byte[] bodys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP POST 字节数组
`static Response` `httpPost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, Map<String,String> bodys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP POST表单
`static Response` `httpPost(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, String body, List<String> signHeaderPrefixList, String appKey, String appSecret)` Http POST 字符
`static Response` `httpPut(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, byte[] bodys, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP PUT字节数组
`static Response` `httpPut(String host, String path, int connectTimeout, Map<String,String> headers, Map<String,String> querys, String body, List<String> signHeaderPrefixList, String appKey, String appSecret)` HTTP PUT 字符丿
`static String` `initUrl(String host, String path, Map<String,String> querys)`
`static String` `inStream2String(InputStream src)`
`static String` `readImageAsStr(byte[] src)` 将流转换为字符串
`static String` `readStreamAsStr(InputStream is)` 将流转换为字符串
`static org.apache.http.client.HttpClient` `wrapClient(String host)`

### 从类继承的方法 java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 构造器详细资料

#### HttpUtil

    public HttpUtil()

### 方法详细资料

#### httpGet

    public static Response httpGet(String host,
                                   String path,
                                   int connectTimeout,
                                   Map<String,String> headers,
                                   Map<String,String> querys,
                                   List<String> signHeaderPrefixList,
                                   String appKey,
                                   String appSecret)
                            throws Exception

HTTP GET

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpImgGet

    public static Response httpImgGet(String host,
                                      String path,
                                      int connectTimeout,
                                      Map<String,String> headers,
                                      Map<String,String> querys,
                                      List<String> signHeaderPrefixList,
                                      String appKey,
                                      String appSecret)
                               throws Exception

抛出:
  `Exception`

#### httpPost

    public static Response httpPost(String host,
                                    String path,
                                    int connectTimeout,
                                    Map<String,String> headers,
                                    Map<String,String> querys,
                                    Map<String,String> bodys,
                                    List<String> signHeaderPrefixList,
                                    String appKey,
                                    String appSecret)
                             throws Exception

HTTP POST表单

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `bodys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpImgPost

    public static Response httpImgPost(String host,
                                       String path,
                                       int connectTimeout,
                                       Map<String,String> headers,
                                       Map<String,String> querys,
                                       Map<String,String> bodys,
                                       List<String> signHeaderPrefixList,
                                       String appKey,
                                       String appSecret)
                                throws Exception

HTTP POST表单

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `bodys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpPost

    public static Response httpPost(String host,
                                    String path,
                                    int connectTimeout,
                                    Map<String,String> headers,
                                    Map<String,String> querys,
                                    String body,
                                    List<String> signHeaderPrefixList,
                                    String appKey,
                                    String appSecret)
                             throws Exception

Http POST 字符

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `body` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpImgPost

    public static Response httpImgPost(String host,
                                       String path,
                                       int connectTimeout,
                                       Map<String,String> headers,
                                       Map<String,String> querys,
                                       String body,
                                       List<String> signHeaderPrefixList,
                                       String appKey,
                                       String appSecret)
                                throws Exception

Http POST 字符

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `body` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpPost

    public static Response httpPost(String host,
                                    String path,
                                    int connectTimeout,
                                    Map<String,String> headers,
                                    Map<String,String> querys,
                                    byte[] bodys,
                                    List<String> signHeaderPrefixList,
                                    String appKey,
                                    String appSecret)
                             throws Exception

HTTP POST 字节数组

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `bodys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpFilePost

    public static Response httpFilePost(String host,
                                        String path,
                                        int connectTimeout,
                                        Map<String,String> headers,
                                        Map<String,String> querys,
                                        Map<String,Object> bodys,
                                        List<String> signHeaderPrefixList,
                                        String appKey,
                                        String appSecret)
                                 throws Exception

HTTP POST 文件上传

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `bodys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpPut

    public static Response httpPut(String host,
                                   String path,
                                   int connectTimeout,
                                   Map<String,String> headers,
                                   Map<String,String> querys,
                                   String body,
                                   List<String> signHeaderPrefixList,
                                   String appKey,
                                   String appSecret)
                            throws Exception

HTTP PUT 字符丿

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `body` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpPut

    public static Response httpPut(String host,
                                   String path,
                                   int connectTimeout,
                                   Map<String,String> headers,
                                   Map<String,String> querys,
                                   byte[] bodys,
                                   List<String> signHeaderPrefixList,
                                   String appKey,
                                   String appSecret)
                            throws Exception

HTTP PUT字节数组

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `bodys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### httpDelete

    public static Response httpDelete(String host,
                                      String path,
                                      int connectTimeout,
                                      Map<String,String> headers,
                                      Map<String,String> querys,
                                      List<String> signHeaderPrefixList,
                                      String appKey,
                                      String appSecret)
                               throws Exception

HTTP DELETE

参数:
  `host` -
  `path` -
  `connectTimeout` -
  `headers` -
  `querys` -
  `signHeaderPrefixList` -
  `appKey` -
  `appSecret` -
返回:
抛出:
  `Exception`

#### initUrl

    public static String initUrl(String host,
                                 String path,
                                 Map<String,String> querys)
                          throws UnsupportedEncodingException

抛出:
  `UnsupportedEncodingException`

#### readStreamAsStr

    public static String readStreamAsStr(InputStream is)
                                  throws IOException

将流转换为字符串

参数:
  `is` -
返回:
抛出:
  `IOException`

#### readImageAsStr

    public static String readImageAsStr(byte[] src)
                                 throws IOException

将流转换为字符串

参数:
  `src` -
返回:
抛出:
  `IOException`

#### inStream2String

    public static String inStream2String(InputStream src)
                                  throws IOException

抛出:
  `IOException`

#### wrapClient

    public static org.apache.http.client.HttpClient wrapClient(String host)