restclient

package
v0.1.1-beta.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

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

func DeleteCall(targetURL string, jsonString []byte) ([]byte, error)

DeleteCall make a DELETE call to targetURL with a json body.

func GetCall

func GetCall(targetURL string, query url.Values) ([]byte, error)

GetCall make a GET call to targetURL with query.

func GetChunk

func GetChunk(targetURL string,
	query url.Values) (*http.Response, error)

GetChunk makes a GET call to HTTP server to download chunk data.

func GetResponse

func GetResponse(req *http.Request) ([]byte, error)

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 PostCall

func PostCall(targetURL string, jsonString []byte) ([]byte, error)

PostCall make a POST call to targetURL with a json body.

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.

func PostFile

func PostFile(targetURL string, filename string, query url.Values) ([]byte, error)

PostFile make a POST call to HTTP server to upload a file.

func Token

func Token(config *config.SubmitConfig) (string, error)

Token fetch and caches the token for current configured user

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL