Versions in this module Expand all Collapse all v1 v1.0.0 Apr 28, 2021 Changes in this version + var ErrNoBody = errors.New("impossible to retrieve data from empty response body") + var ErrNoMatch = errors.New("actual value does not match expected") + var ErrNoPath = errors.New("path does not exists in object") + var ErrNoRequest = errors.New("trying to emit empty request") + var ErrNotFullyMatch = errors.New("expected values to be fully matched but it was not") + var ErrUnknownKey = errors.New("unknown key") + func Debug() + func NoLog() + func Reset() error + func ResetLog() + type Client struct + Response *Response + func NewClient(cli *http.Client) (*Client, error) + func (cli *Client) EmitRequest(req RequestPreparation) (err error) + func (cli *Client) Reset() + func (cli *Client) SetFollowRedirection(follow bool) + func (cli *Client) SetTrace(activate bool) + func (cli Client) HasCookie(cookieName string) bool + type RequestPreparation struct + AllowCookie bool + Arguments map[string]string + Cookies []*http.Cookie + Endpoint string + FORMBody map[string]formElement + Headers *http.Header + JSONBody *string + Method string + func PrepareRequest(withCookie bool) RequestPreparation + func (request RequestPreparation) AddArgument(key, value string) RequestPreparation + func (request RequestPreparation) AddCookie(key, val string, options *messages.PickleStepArgument_PickleTable) (RequestPreparation, error) + func (request RequestPreparation) AddHeader(key, value string) RequestPreparation + func (request RequestPreparation) AllowCookies(allow bool) RequestPreparation + func (request RequestPreparation) Empty() bool + func (request RequestPreparation) GenerateRequest(jar http.CookieJar) (*http.Request, error) + func (request RequestPreparation) ResetArguments() RequestPreparation + func (request RequestPreparation) ResetBody() RequestPreparation + func (request RequestPreparation) ResetCookies() RequestPreparation + func (request RequestPreparation) ResetHeader() RequestPreparation + func (request RequestPreparation) SetEndpoint(endpoint string) RequestPreparation + func (request RequestPreparation) SetFORMBody(body *godog.Table) RequestPreparation + func (request RequestPreparation) SetJSONBody(body *godog.DocString) RequestPreparation + func (request RequestPreparation) SetMethod(method string) RequestPreparation + type Response struct + Body []byte + Cookies map[string]*http.Cookie + Headers http.Header + Status int + func NewResponse(status int, body []byte, cookies []*http.Cookie, headers http.Header) *Response + func (r Response) GetCookie(cookieName string) *http.Cookie + func (r Response) HTMLContain(expectedBody *godog.Table) error + func (r Response) HTMLResemble(expectedBody *godog.DocString) error + func (r Response) HasCookie(cookieName string) bool + func (r Response) HasEmptyBody() bool + func (r Response) HasStatus(status int) bool + func (r Response) HeaderMatches(expected *godog.Table) error + func (r Response) JSONContains(fully bool, expected *godog.Table) error + func (r Response) JSONResemble(expectedBody *godog.DocString) error + func (r Response) RetrieveHTMLAttribute(tag, attribute string, filters *godog.Table) (string, error) + func (r Response) RetrieveHeader(key string) string + func (r Response) RetrieveJSON(key string) (interface{}, error)