unirest

package module
v0.0.0-...-dacfb3e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2017 License: MIT Imports: 16 Imported by: 2

README

Unirest HTTP Client for Go

Modified fork of unirest to work with Threema's self-signed certificate

original code at https://github.com/apimatic/unirest-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(data interface{}, dVal string) string

*

  • Uses reflection to get string representation of a given data
  • @param data The given data for the finding the string representation
  • @param dVal The default value string to use if the given value is nil

Types

type HttpMethod

type HttpMethod int
const (
	GET HttpMethod = 1 + iota
	POST
	PUT
	PATCH
	DELETE
)

func (HttpMethod) ToString

func (method HttpMethod) ToString() string

type Request

type Request struct {
	// contains filtered or unexported fields
}

func Delete

func Delete(url string, headers map[string]interface{}) *Request

func DeleteWithAuth

func DeleteWithAuth(url string, headers map[string]interface{}, username string, password string) *Request

func Get

func Get(url string, headers map[string]interface{}) *Request

func GetWithAuth

func GetWithAuth(url string, headers map[string]interface{}, username string, password string) *Request

func NewRequest

func NewRequest(method HttpMethod, url string,
	headers map[string]interface{}, parameters interface{},
	username string, password string) *Request

func Patch

func Patch(url string, headers map[string]interface{}, body interface{}) *Request

func PatchWithAuth

func PatchWithAuth(url string, headers map[string]interface{}, body interface{}, username string, password string) *Request

func Post

func Post(url string, headers map[string]interface{}, body interface{}) *Request

func PostWithAuth

func PostWithAuth(url string, headers map[string]interface{}, body interface{}, username string, password string) *Request

func Put

func Put(url string, headers map[string]interface{}, body interface{}) *Request

func PutWithAuth

func PutWithAuth(url string, headers map[string]interface{}, body interface{}, username string, password string) *Request

func (*Request) PerformRequest

func (me *Request) PerformRequest() (*http.Response, error)

type Response

type Response struct {
	Code    int
	RawBody []byte
	Body    string
	Headers map[string][]string
}

func AsBinary

func AsBinary(request *Request) (*Response, error)

func AsString

func AsString(request *Request) (*Response, error)

func NewBinaryResponse

func NewBinaryResponse(resp *http.Response) (*Response, error)

func NewStringResponse

func NewStringResponse(resp *http.Response) (*Response, error)

Jump to

Keyboard shortcuts

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