Documentation ¶
Index ¶
- func Do(req *http.Request) (*http.Response, error)
- func DoWithClient(client http.Client, req *http.Request) (*http.Response, error)
- func ReadBodyRequest(r *http.Request) ([]byte, error)
- func ReadBodyResponse(r *http.Response) ([]byte, error)
- type Request
- func (r *Request) BasicAuth(username, password string) *Request
- func (r *Request) Build(ctx context.Context, payload io.Reader) (*http.Request, error)
- func (r *Request) ContentForm() *Request
- func (r *Request) ContentJSON() *Request
- func (r *Request) ContentType(contentType string) *Request
- func (r *Request) Delete(url string) *Request
- func (r *Request) Form(ctx context.Context, data url.Values) (*http.Response, error)
- func (r *Request) Get(url string) *Request
- func (r *Request) Header(name, value string) *Request
- func (r *Request) JSON(ctx context.Context, body interface{}) (*http.Response, error)
- func (r *Request) Method(method string) *Request
- func (r *Request) Patch(url string) *Request
- func (r *Request) Post(url string) *Request
- func (r *Request) Put(url string) *Request
- func (r *Request) Send(ctx context.Context, payload io.Reader) (*http.Response, error)
- func (r *Request) URL(url string) *Request
- func (r *Request) WithClient(client http.Client) *Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoWithClient ¶
DoWithClient send request with given client
func ReadBodyRequest ¶
ReadBodyRequest return content of a body request (defined as a ReadCloser)
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request describe a complete request
func (*Request) ContentForm ¶
ContentForm set Content-Type header to application/x-www-form-urlencoded
func (*Request) ContentJSON ¶
ContentJSON set Content-Type header to application/json
func (*Request) ContentType ¶
ContentType set Content-Type header
Click to show internal directories.
Click to hide internal directories.