httpie

package
v0.0.0-...-290008c Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEP_HEADER    = ":"
	SEP_URL_PARAM = "=="
	SEP_DATA      = "="
	SEP_JSON      = ":="
	SEP_FILE      = "@"
)

Variables

View Source
var (
	JSONFlag            = &Flag{Long: "json", Short: 'j'}
	FormFlag            = &Flag{Long: "form", Short: 'f'}
	PrettyFlag          = &Flag{Long: "pretty", HasArg: true}
	StyleFlag           = &Flag{Long: "style", Short: 's', HasArg: true}
	PrintFlag           = &Flag{Long: "print", Short: 'p', HasArg: true}
	HeadersFlag         = &Flag{Long: "headers", Short: 'h'}
	BodyFlag            = &Flag{Long: "body", Short: 'b'}
	VerboseFlag         = &Flag{Long: "verbose", Short: 'v'}
	AllFlag             = &Flag{Long: "all"}
	HistoryPrintFlag    = &Flag{Long: "history-print", Short: 'P'}
	StreamFlag          = &Flag{Long: "stream", Short: 'S'}
	OutputFlag          = &Flag{Long: "output", Short: 'o'}
	DownloadFlag        = &Flag{Long: "download", Short: 'd'}
	ContinueFlag        = &Flag{Long: "continue", Short: 'c'}
	SessionFlag         = &Flag{Long: "session", HasArg: true}
	SessionReadOnlyFlag = &Flag{Long: "session-read-only", HasArg: true}
	CheckStatusFlag     = &Flag{Long: "check-status"}
	IgnoreStdinFlag     = &Flag{Long: "ignore-stdin", Short: 'I'}
	HelpFlag            = &Flag{Long: "help"}
	VersionFlag         = &Flag{Long: "version"}
	TracebackFlag       = &Flag{Long: "traceback"}
	DefaultSchemeFlag   = &Flag{Long: "default-scheme", HasArg: true}
	DebugFlag           = &Flag{Long: "debug"}
	AuthFlag            = &Flag{Long: "auth", Short: 'a', HasArg: true}
	AuthTypeFlag        = &Flag{Long: "auth-type", Short: 'A', HasArg: true}
	ProxyFlag           = &Flag{Long: "proxy", HasArg: true}
	FollowFlag          = &Flag{Long: "follow", Short: 'F', HasArg: false}
	MaxRedirectsFlag    = &Flag{Long: "max-redirects", HasArg: true}
	TimeoutFlag         = &Flag{Long: "timeout", HasArg: true}
	VerifyFlag          = &Flag{Long: "verify", HasArg: true}
	SSLFlag             = &Flag{Long: "ssl", HasArg: true}
	CertFlag            = &Flag{Long: "cert", HasArg: true}
	CertKeyFlag         = &Flag{Long: "cert-key", HasArg: true}
)

Functions

This section is empty.

Types

type CmdLine

type CmdLine struct {
	Flags         []*Flag
	Method        *Method
	URL           string
	IsHttps       bool
	Items         []*Item
	HasBody       bool
	ContentType   string
	DirectedInput io.ReadCloser
}

func NewCmdLine

func NewCmdLine() *CmdLine

func NewCmdLineByArgs

func NewCmdLineByArgs(args []string) (*CmdLine, error)

func (*CmdLine) AddFlag

func (cl *CmdLine) AddFlag(f *Flag)

func (*CmdLine) AddItem

func (cl *CmdLine) AddItem(i *Item)

func (*CmdLine) SetMethod

func (cl *CmdLine) SetMethod(m *Method)

func (*CmdLine) SetURL

func (cl *CmdLine) SetURL(url string)

func (*CmdLine) String

func (cl *CmdLine) String() string

type Flag

type Flag struct {
	Long      string
	Short     byte
	HasArg    bool
	Arg       string
	Separator string
}

func AuthFlagWithArg

func AuthFlagWithArg(auth string) *Flag

func NewFlag

func NewFlag(l string) *Flag

func (*Flag) SetArg

func (f *Flag) SetArg(arg string, separator string)

func (*Flag) SetShort

func (f *Flag) SetShort(s byte)

func (*Flag) String

func (f *Flag) String() string

type Item

type Item struct {
	K string
	V string
	S string
}

func NewDataField

func NewDataField(key, val string) *Item

func NewFileField

func NewFileField(key, val string) *Item

func NewHeader

func NewHeader(key, val string) *Item

func NewJSONField

func NewJSONField(key, val string) *Item

func NewURLParam

func NewURLParam(key, val string) *Item

func (*Item) String

func (i *Item) String() string

type Method

type Method string

func NewMethod

func NewMethod(method string) *Method

func (Method) String

func (m Method) String() string

Jump to

Keyboard shortcuts

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