Documentation ¶
Index ¶
- func PostFile(url string, params map[string]string, nameField string, fileName string, ...) ([]byte, error)
- type HttpSession
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) AllowRedirect(allow bool) *RequestBuilder
- func (rb *RequestBuilder) Body(body string) *RequestBuilder
- func (rb *RequestBuilder) Get(url string) *RequestBuilder
- func (rb *RequestBuilder) GetRequest() *Request
- func (rb *RequestBuilder) Header(key string, value string) *RequestBuilder
- func (rb *RequestBuilder) Headers(headers map[string]string) *RequestBuilder
- func (rb *RequestBuilder) Method(method string) *RequestBuilder
- func (rb *RequestBuilder) Param(key string, value string) *RequestBuilder
- func (rb *RequestBuilder) ParamString(params string) *RequestBuilder
- func (rb *RequestBuilder) Params(params map[string]string) *RequestBuilder
- func (rb *RequestBuilder) Post(url string) *RequestBuilder
- func (rb *RequestBuilder) Send() *ResponseParser
- func (rb *RequestBuilder) SendWithRequest(req *Request) *ResponseParser
- func (rb *RequestBuilder) Timeout(timeout int) *RequestBuilder
- func (rb *RequestBuilder) Url(url string) *RequestBuilder
- func (rb *RequestBuilder) WithHttpRequest(request *http.Request) *RequestBuilder
- type Response
- type ResponseParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpSession ¶
func (*HttpSession) GetCookieString ¶
func (session *HttpSession) GetCookieString() string
func (*HttpSession) SetCookie ¶
func (session *HttpSession) SetCookie(cookies []*http.Cookie)
type RequestBuilder ¶
type RequestBuilder struct { HttpSession *HttpSession Request *Request }
func Get ¶
func Get(url string) *RequestBuilder
func NewHttpSession ¶
func NewHttpSession() *RequestBuilder
func NewRequest ¶
func NewRequest() *RequestBuilder
func Post ¶
func Post(url string) *RequestBuilder
func (*RequestBuilder) AllowRedirect ¶
func (rb *RequestBuilder) AllowRedirect(allow bool) *RequestBuilder
func (*RequestBuilder) Body ¶
func (rb *RequestBuilder) Body(body string) *RequestBuilder
func (*RequestBuilder) Get ¶
func (rb *RequestBuilder) Get(url string) *RequestBuilder
func (*RequestBuilder) GetRequest ¶
func (rb *RequestBuilder) GetRequest() *Request
func (*RequestBuilder) Header ¶
func (rb *RequestBuilder) Header(key string, value string) *RequestBuilder
func (*RequestBuilder) Headers ¶
func (rb *RequestBuilder) Headers(headers map[string]string) *RequestBuilder
func (*RequestBuilder) Method ¶
func (rb *RequestBuilder) Method(method string) *RequestBuilder
func (*RequestBuilder) Param ¶
func (rb *RequestBuilder) Param(key string, value string) *RequestBuilder
func (*RequestBuilder) ParamString ¶
func (rb *RequestBuilder) ParamString(params string) *RequestBuilder
func (*RequestBuilder) Params ¶
func (rb *RequestBuilder) Params(params map[string]string) *RequestBuilder
func (*RequestBuilder) Post ¶
func (rb *RequestBuilder) Post(url string) *RequestBuilder
func (*RequestBuilder) Send ¶
func (rb *RequestBuilder) Send() *ResponseParser
func (*RequestBuilder) SendWithRequest ¶
func (rb *RequestBuilder) SendWithRequest(req *Request) *ResponseParser
func (*RequestBuilder) Timeout ¶
func (rb *RequestBuilder) Timeout(timeout int) *RequestBuilder
func (*RequestBuilder) Url ¶
func (rb *RequestBuilder) Url(url string) *RequestBuilder
func (*RequestBuilder) WithHttpRequest ¶
func (rb *RequestBuilder) WithHttpRequest(request *http.Request) *RequestBuilder
type Response ¶
type Response struct { HttpResponse *http.Response ResponseWriter http.ResponseWriter Body string Headers map[string]string Status int Time int64 Proto string ContentLength int64 }
func SendRequest ¶
func SendRequest(req *Request, session *HttpSession) (*Response, error)
type ResponseParser ¶
func (*ResponseParser) ReadToJsonObject ¶ added in v1.0.1
func (rp *ResponseParser) ReadToJsonObject() (*json.Object, error)
func (*ResponseParser) ReadToText ¶
func (rp *ResponseParser) ReadToText() (string, error)
Click to show internal directories.
Click to hide internal directories.