Documentation ¶
Index ¶
- 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)
- type HeaderKeyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Note:
outResponseProtoBufObjectPtr: if err == nil, then this output parameter is guaranteed to be Not Nil
func POST ¶
func POST(url string, headers []*HeaderKeyValue, requestBody string) (statusCode int, responseBody string, err error)
POST sends url post request to host with simple form data and retrieve the body response in string
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
Note:
outResponseProtoBufObjectPtr: if err == nil, then this output parameter is guaranteed to be Not Nil
Types ¶
type HeaderKeyValue ¶
HeaderKeyValue is struct used for containing http header element key value pair
Click to show internal directories.
Click to hide internal directories.