Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request interface {
Get(uri string) (Response, error)
Post(uri string, body io.Reader) (Response, error)
Put(uri string, body io.Reader) (Response, error)
Delete(uri string, body io.Reader) (Response, error)
Patch(uri string, body io.Reader) (Response, error)
Head(uri string) (Response, error)
Options(uri string) (Response, error)
Accept(contentType string) Request
AcceptJSON() Request
AsForm() Request
Bind(value any) Request
Clone() Request
FlushHeaders() Request
ReplaceHeaders(headers map[string]string) Request
WithBasicAuth(username, password string) Request
WithContext(ctx context.Context) Request
WithCookies(cookies []*http.Cookie) Request
WithCookie(cookie *http.Cookie) Request
WithHeader(key, value string) Request
WithHeaders(map[string]string) Request
WithQueryParameter(key, value string) Request
WithQueryParameters(map[string]string) Request
WithQueryString(query string) Request
WithoutHeader(key string) Request
WithToken(token string, ttype ...string) Request
WithoutToken() Request
WithUrlParameter(key, value string) Request
WithUrlParameters(map[string]string) Request
}
type Response ¶
type Response interface {
Body() (string, error)
ClientError() bool
Cookie(name string) *http.Cookie
Cookies() []*http.Cookie
Failed() bool
Header(name string) string
Headers() http.Header
Json() (map[string]any, error)
Redirect() bool
ServerError() bool
Status() int
Successful() bool
OK() bool // 200 OK
Created() bool // 201 Created
Accepted() bool // 202 Accepted
NoContent() bool // 204 No Content
MovedPermanently() bool // 301 Moved Permanently
Found() bool // 302 Found
BadRequest() bool // 400 Bad Request
PaymentRequired() bool // 402 Payment Required
Forbidden() bool // 403 Forbidden
NotFound() bool // 404 Not Found
RequestTimeout() bool // 408 Request Timeout
Conflict() bool // 409 Conflict
UnprocessableEntity() bool // 422 Unprocessable Entity
TooManyRequests() bool // 429 Too Many Requests
}
Click to show internal directories.
Click to hide internal directories.