Documentation ¶
Index ¶
- func AppendServerCAPemFiles(caPemFilePath ...string) error
- func DELETE(url string, headers []*HeaderKeyValue) (statusCode int, body string, err error)
- func DELETEProtoBuf(url string, headers []*HeaderKeyValue, ...) (statusCode int, err error)
- func GET(url string, headers []*HeaderKeyValue) (statusCode int, body string, err error)
- func GETProtoBuf(url string, headers []*HeaderKeyValue, ...) (statusCode int, err error)
- func POST(url string, headers []*HeaderKeyValue, requestBody string) (statusCode int, responseBody string, err error)
- func POSTProtoBuf(url string, headers []*HeaderKeyValue, requestProtoBufObjectPtr proto.Message, ...) (statusCode int, err error)
- func PUT(url string, headers []*HeaderKeyValue, requestBody string) (statusCode int, responseBody string, err error)
- func PUTProtoBuf(url string, headers []*HeaderKeyValue, requestProtoBufObjectPtr proto.Message, ...) (statusCode int, err error)
- func ResetServerCAPemFiles(caPemFilePath ...string) error
- type HeaderKeyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendServerCAPemFiles ¶ added in v1.1.4
AppendServerCAPemFiles adds self-signed server ca pems to local cache, and then recreates the clientTlsConfig object based on the new list of CAs
func DELETE ¶ added in v1.1.4
func DELETE(url string, headers []*HeaderKeyValue) (statusCode int, body string, err error)
DELETE sends url delete request to host and performs delete action (no body expected)
Default Header = Content-Type: application/x-www-form-urlencoded
JSON Content-Type Header:
Content-Type: application/json
func DELETEProtoBuf ¶ added in v1.1.4
func DELETEProtoBuf(url string, headers []*HeaderKeyValue, outResponseProtoBufObjectPtr proto.Message) (statusCode int, err error)
DELETEProtoBuf sends url delete request to host, and retrieves response via protobuf object as an output pointer parameter
default header if not specified:
Content-Type: application/x-protobuf
func GET ¶
func GET(url string, headers []*HeaderKeyValue) (statusCode int, body string, err error)
GET sends url get request to host and retrieve the body response in string
func GETProtoBuf ¶
func GETProtoBuf(url string, headers []*HeaderKeyValue, outResponseProtoBufObjectPtr proto.Message) (statusCode int, err error)
GETProtoBuf sends url get request to host, and retrieves response via protobuf object as an output pointer parameter
default header if not specified:
Content-Type: application/x-protobuf
func POST ¶
func POST(url string, headers []*HeaderKeyValue, requestBody string) (statusCode int, responseBody string, err error)
POST sends url post request to host and retrieve the body response in string
Default Header = Content-Type: application/x-www-form-urlencoded
JSON Content-Type Header:
Content-Type: application/json
func POSTProtoBuf ¶
func POSTProtoBuf(url string, headers []*HeaderKeyValue, requestProtoBufObjectPtr proto.Message, outResponseProtoBufObjectPtr proto.Message) (statusCode int, err error)
POSTProtoBuf sends url post request to host, with body content in protobuf pointer object, and retrieves response in protobuf object as output pointer parameter
default header if not specified:
Content-Type: application/x-protobuf
func PUT ¶ added in v1.1.4
func PUT(url string, headers []*HeaderKeyValue, requestBody string) (statusCode int, responseBody string, err error)
PUT sends url put request to host and retrieve the body response in string
Default Header = Content-Type: application/x-www-form-urlencoded
JSON Content-Type Header:
Content-Type: application/json
func PUTProtoBuf ¶ added in v1.1.4
func PUTProtoBuf(url string, headers []*HeaderKeyValue, requestProtoBufObjectPtr proto.Message, outResponseProtoBufObjectPtr proto.Message) (statusCode int, err error)
PUTProtoBuf sends url put request to host, with body content in protobuf pointer object, and retrieves response in protobuf object as output pointer parameter
default header if not specified:
Content-Type: application/x-protobuf
func ResetServerCAPemFiles ¶ added in v1.1.4
ResetServerCAPemFiles first clears serverCaPems cache, then adds self-signed server ca pems to local cache, then recreates the clientTlsConfig object based on the new list of CAs
Types ¶
type HeaderKeyValue ¶
HeaderKeyValue is struct used for containing http header element key value pair