rest

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	*resty.Request
}

Request implements the Alauda REST request.

func NewRequest

func NewRequest(token string) *Request

NewRequest creates a base Request object.

func (*Request) Delete

func (req *Request) Delete(url string) (*Response, error)

Delete executes a DELETE request.

func (*Request) Get

func (req *Request) Get(url string) (*Response, error)

Get executes a GET request.

func (*Request) Post

func (req *Request) Post(url string) (*Response, error)

Post executes a POST request.

func (*Request) Put

func (req *Request) Put(url string) (*Response, error)

Put executes a PUT request.

type Response

type Response struct {
	*resty.Response
}

Response implements the Alauda REST response.

func NewResponse

func NewResponse(response *resty.Response) *Response

NewResponse creates a new Alauda response.

func (*Response) CheckStatusCode

func (resp *Response) CheckStatusCode() error

CheckStatusCode returns the error message if the code indicates failure.

func (*Response) Pretty

func (resp *Response) Pretty() string

Pretty is the response body JSON string pretty-printed.

Jump to

Keyboard shortcuts

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