Documentation
¶
Index ¶
- type Request
- func (r *Request) Accept(contentType string) client.Request
- func (r *Request) AcceptJSON() client.Request
- func (r *Request) AsForm() client.Request
- func (r *Request) Bind(value any) client.Request
- func (r *Request) Clone() client.Request
- func (r *Request) Delete(uri string, body io.Reader) (client.Response, error)
- func (r *Request) FlushHeaders() client.Request
- func (r *Request) Get(uri string) (client.Response, error)
- func (r *Request) Head(uri string) (client.Response, error)
- func (r *Request) Options(uri string) (client.Response, error)
- func (r *Request) Patch(uri string, body io.Reader) (client.Response, error)
- func (r *Request) Post(uri string, body io.Reader) (client.Response, error)
- func (r *Request) Put(uri string, body io.Reader) (client.Response, error)
- func (r *Request) ReplaceHeaders(headers map[string]string) client.Request
- func (r *Request) WithBasicAuth(username, password string) client.Request
- func (r *Request) WithContext(ctx context.Context) client.Request
- func (r *Request) WithCookie(cookie *http.Cookie) client.Request
- func (r *Request) WithCookies(cookies []*http.Cookie) client.Request
- func (r *Request) WithHeader(key, value string) client.Request
- func (r *Request) WithHeaders(headers map[string]string) client.Request
- func (r *Request) WithQueryParameter(key, value string) client.Request
- func (r *Request) WithQueryParameters(params map[string]string) client.Request
- func (r *Request) WithQueryString(query string) client.Request
- func (r *Request) WithToken(token string, ttype ...string) client.Request
- func (r *Request) WithUrlParameter(key, value string) client.Request
- func (r *Request) WithUrlParameters(params map[string]string) client.Request
- func (r *Request) WithoutHeader(key string) client.Request
- func (r *Request) WithoutToken() client.Request
- type Response
- func (r *Response) Accepted() bool
- func (r *Response) BadRequest() bool
- func (r *Response) Body() (string, error)
- func (r *Response) ClientError() bool
- func (r *Response) Conflict() bool
- func (r *Response) Cookie(name string) *http.Cookie
- func (r *Response) Cookies() []*http.Cookie
- func (r *Response) Created() bool
- func (r *Response) Failed() bool
- func (r *Response) Forbidden() bool
- func (r *Response) Found() bool
- func (r *Response) Header(name string) string
- func (r *Response) Headers() http.Header
- func (r *Response) Json() (map[string]any, error)
- func (r *Response) MovedPermanently() bool
- func (r *Response) NoContent() bool
- func (r *Response) NotFound() bool
- func (r *Response) OK() bool
- func (r *Response) PaymentRequired() bool
- func (r *Response) Redirect() bool
- func (r *Response) RequestTimeout() bool
- func (r *Response) ServerError() bool
- func (r *Response) Status() int
- func (r *Response) Successful() bool
- func (r *Response) TooManyRequests() bool
- func (r *Response) Unauthorized() bool
- func (r *Response) UnprocessableEntity() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(config *client.Config, json foundation.Json) *Request
func (*Request) AcceptJSON ¶
func (*Request) FlushHeaders ¶
func (*Request) ReplaceHeaders ¶
func (*Request) WithBasicAuth ¶
func (*Request) WithHeaders ¶
func (*Request) WithQueryParameter ¶
func (*Request) WithQueryParameters ¶
func (*Request) WithUrlParameter ¶
func (*Request) WithUrlParameters ¶
func (*Request) WithoutToken ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(response *http.Response, json foundation.Json) *Response
func (*Response) BadRequest ¶
BadRequest checks if the status code is 400.
func (*Response) ClientError ¶
func (*Response) MovedPermanently ¶
MovedPermanently checks if the status code is 301.
func (*Response) PaymentRequired ¶
PaymentRequired checks if the status code is 402.
func (*Response) RequestTimeout ¶
RequestTimeout checks if the status code is 408.
func (*Response) ServerError ¶
func (*Response) Successful ¶
func (*Response) TooManyRequests ¶
TooManyRequests checks if the status code is 429.
func (*Response) Unauthorized ¶
Unauthorized checks if the status code is 401.
func (*Response) UnprocessableEntity ¶
UnprocessableEntity checks if the status code is 422.
Click to show internal directories.
Click to hide internal directories.