Documentation ¶
Index ¶
- func ContentLength(r *HttpRequest) int64
- func Dump(r *HttpRequest) []byte
- func FormatResponseBody(resp *http.Response) []byte
- func FormatResponseHeader(method string, resp *http.Response) []byte
- func Header(r *HttpRequest, key string) string
- func Method(r *HttpRequest) string
- func ParseRequestBody(data string) string
- func Response(r *HttpRequest) *http.Response
- func SendRequest(r *HttpRequest) (*http.Response, error)
- func SetHeader(r *HttpRequest, key, value string)
- type HttpRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentLength ¶
func ContentLength(r *HttpRequest) int64
func Dump ¶
func Dump(r *HttpRequest) []byte
func FormatResponseBody ¶
func Header ¶
func Header(r *HttpRequest, key string) string
func Method ¶
func Method(r *HttpRequest) string
func ParseRequestBody ¶
Files are prefixed by '@' symbol; else, treat as string data
func SendRequest ¶
func SendRequest(r *HttpRequest) (*http.Response, error)
Issues an HTTP request and returns the response
Types ¶
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func Body ¶
func Body(r *HttpRequest, d string) *HttpRequest
Adds content to request body (PUT, POST)
func Head ¶
func Head(uri string) *HttpRequest
func NewHttpRequest ¶
func NewHttpRequest(uri, method string) *HttpRequest
Constructs a new HTTP request
Click to show internal directories.
Click to hide internal directories.