Documentation ¶
Index ¶
Examples ¶
Constants ¶
Variables ¶
Functions ¶
func PrintBody ¶
func PrintBody(resp *requests4go.Response) error
func PrintHeaders ¶
func PrintHeaders(resp *requests4go.Response)
Types ¶
type ArgsParser ¶
type ArgsParser interface { // Headers returns the headers from the args. // "foo:bar" => map[string]string{"foo": "bar"} Headers() map[string]string // QueryParams returns the query from the args. // "foo=bar" => map[string]string{"foo": "bar"} QueryParams() map[string]string }
func NewDefaultParser ¶
func NewDefaultParser(args []string) ArgsParser
type DefaultParser ¶
type DefaultParser struct {
// contains filtered or unexported fields
}
func (*DefaultParser) Headers ¶
func (p *DefaultParser) Headers() map[string]string
Headers parses header from args
Example ¶
p := NewDefaultParser([]string{"Accept: application/json", "User-Agent: httpie"}) fmt.Println(p.Headers())
Output: map[Accept:application/json User-Agent:httpie]
func (*DefaultParser) QueryParams ¶
func (p *DefaultParser) QueryParams() map[string]string
Example ¶
p := NewDefaultParser([]string{"foo==bar"}) fmt.Println(p.QueryParams())
Output: map[foo:bar]
Click to show internal directories.
Click to hide internal directories.