1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| package gb28181api
|
| import (
| "strconv"
| )
|
| type Client interface {
| //GET
| DoGetRequest(url string, params map[string]string, headers map[string]string) ([]byte, error)
| //POST
| DoPostRequest(url string, contentType string, body map[string]interface{}, params map[string]string, headers map[string]string) ([]byte, error)
| //PUT
| DoPutRequest(url string, contentType string, body map[string]interface{}, headers map[string]string) ([]byte, error)
| //DELETE
| DoDeleteRequest(url string, contentType string, body map[string]interface{}, headers map[string]string) ([]byte, error)
| }
|
| var BASIC_URL = "http://192.168.1.203:8060"
|
| const (
| DATA_URL_PREFIX = "/vssconfig"
| CONTENT_TYPE_FORM = "application/x-www-form-urlencoded"
| CONTENT_TYPE_MULFORM = "multipart/form-data"
| CONTENT_TYPE_JSON = "application/json"
| )
|
| //初始化dbserver的地址和端口
| func Init(ip string, port int) {
| BASIC_URL = "http://" + ip + ":" + strconv.Itoa(port)
| }
|
|