httplib

package
v0.0.0-...-50c958a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 FormatResponseBody(resp *http.Response) []byte
func Header(r *HttpRequest, key string) string

func Method

func Method(r *HttpRequest) string

func ParseRequestBody

func ParseRequestBody(data string) string

Files are prefixed by '@' symbol; else, treat as string data

func Response

func Response(r *HttpRequest) *http.Response

Getters

func SendRequest

func SendRequest(r *HttpRequest) (*http.Response, error)

Issues an HTTP request and returns the response

func SetHeader

func SetHeader(r *HttpRequest, key, value string)

Setters

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 Get

func Get(uri string) *HttpRequest

HTTP GET

func Head(uri string) *HttpRequest

func NewHttpRequest

func NewHttpRequest(uri, method string) *HttpRequest

Constructs a new HTTP request

func Post

func Post(uri string, d string) *HttpRequest

HTTP POST

func Put

func Put(uri string, d string) *HttpRequest

HTTP PUT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL