httputil

package
v0.11.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 1 module, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoOptions

type DoOptions struct {
	Data      interface{}
	Context   context.Context
	Headers   map[string]string
	ForceJSON bool
}

DoOptions are options passed to the HTTPClient.Do function

type Error

type Error struct {
	Status  int
	Message string
}

Error is a custom HTTP error structure

func (*Error) Error

func (e *Error) Error() string

Error implemented to match Error interface

type HTTPClient

type HTTPClient struct {
	HTTPClient *http.Client
}

HTTPClient returns an HTTP Client struct that can execute HTTP requests

func NewHTTPClient

func NewHTTPClient() *HTTPClient

NewHTTPClient returns a new HTTP Client

func (*HTTPClient) Do

func (c *HTTPClient) Do(method, path string, doOptions *DoOptions) (*http.Response, error)

Do executes the given HTTP request and returns the HTTP Response

type HTTPResponse

type HTTPResponse struct {
	Raw  *http.Response
	Body string
}

HTTPResponse houses respnse object

Jump to

Keyboard shortcuts

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