Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteCall(targetURL string, jsonString []byte) ([]byte, error)
- func GetCall(targetURL string, query url.Values) ([]byte, error)
- func GetChunk(targetURL string, query url.Values) (*http.Response, error)
- func GetResponse(req *http.Request) ([]byte, error)
- func MakeRequest(uri string, method string, body io.Reader, contentType string, ...) (*http.Request, error)
- func MakeRequestToken(uri string, method string, body io.Reader, contentType string, ...) (*http.Request, error)
- func PostCall(targetURL string, jsonString []byte) ([]byte, error)
- func PostChunk(targetURL string, chunkName string, reader io.Reader, len int64, ...) ([]byte, error)
- func PostFile(targetURL string, filename string, query url.Values) ([]byte, error)
- func Token(config *config.SubmitConfig) (string, error)
Constants ¶
View Source
const HTTPOK = "200 OK"
HTTPOK is ok status of http api call.
Variables ¶
View Source
var HTTPClient = http.DefaultClient
HTTPClient is a global Http client obj conains one persist connection.
Functions ¶
func DeleteCall ¶
DeleteCall make a DELETE call to targetURL with a json body.
func GetResponse ¶
GetResponse will do the request and get response from server.
func MakeRequest ¶
func MakeRequest(uri string, method string, body io.Reader, contentType string, query url.Values, authHeader map[string]string) (*http.Request, error)
MakeRequest returns a general HTTP request object.
func MakeRequestToken ¶
func MakeRequestToken(uri string, method string, body io.Reader, contentType string, query url.Values) (*http.Request, error)
MakeRequestToken use client token to make a authorized request.
func PostChunk ¶
func PostChunk(targetURL string, chunkName string, reader io.Reader, len int64, boundary string) ([]byte, error)
PostChunk makes a POST call to HTTP server to upload chunkdata.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.