httpie

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

README

HTTPie

image

HTTPie is a Postman command line alternative.

For further information about HTTPie please navigate the HTTPie website.

This wrapper do not install HTTPie, to install the right version on your machine visit https://httpie.io/docs/cli/installation

Documentation

Index

Constants

View Source
const (
	AuthBasic  = "basic"
	AuthDigest = "digest"
	AuthBearer = "bearer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpieExec

type HttpieExec struct {
	// contains filtered or unexported fields
}

HttpieExec httpie wrapper. https://httpie.io/docs/cli

func NewExec

func NewExec(execPath string, logger gg_log.ILogger) *HttpieExec

func (*HttpieExec) Close

func (instance *HttpieExec) Close() *HttpieExec

Close remove session file if any

func (*HttpieExec) CmdRun

func (instance *HttpieExec) CmdRun(command ...string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdRunFile

func (instance *HttpieExec) CmdRunFile(filename string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdRunRaw

func (instance *HttpieExec) CmdRunRaw(command ...string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdRunText

func (instance *HttpieExec) CmdRunText(command string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdRunTextRaw

func (instance *HttpieExec) CmdRunTextRaw(command string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdSaveRequest

func (instance *HttpieExec) CmdSaveRequest(filename string, command ...string) (response *httpie_response.HttpieResponse, err error)

func (*HttpieExec) CmdTryToInstall

func (instance *HttpieExec) CmdTryToInstall() (response string, err error)

func (*HttpieExec) CmdTryToUpdate

func (instance *HttpieExec) CmdTryToUpdate() (response string, err error)

func (*HttpieExec) CmdVersion

func (instance *HttpieExec) CmdVersion() (response string, err error)

func (*HttpieExec) GetAuthPsw

func (instance *HttpieExec) GetAuthPsw() string

func (*HttpieExec) GetAuthType

func (instance *HttpieExec) GetAuthType() string

func (*HttpieExec) GetAuthUser

func (instance *HttpieExec) GetAuthUser() string

func (*HttpieExec) GetFollowAll

func (instance *HttpieExec) GetFollowAll() bool

func (*HttpieExec) GetFollowMax

func (instance *HttpieExec) GetFollowMax() int

func (*HttpieExec) GetMaxRedirects

func (instance *HttpieExec) GetMaxRedirects() int

func (*HttpieExec) GetPath

func (instance *HttpieExec) GetPath(path string) (response string)

func (*HttpieExec) GetPrintBody

func (instance *HttpieExec) GetPrintBody() bool

func (*HttpieExec) GetPrintHeaders

func (instance *HttpieExec) GetPrintHeaders() bool

func (*HttpieExec) GetPrintMeta

func (instance *HttpieExec) GetPrintMeta() bool

func (*HttpieExec) GetRoot

func (instance *HttpieExec) GetRoot() string

func (*HttpieExec) GetSessionData

func (instance *HttpieExec) GetSessionData() map[string]interface{}

func (*HttpieExec) GetTimeoutSec

func (instance *HttpieExec) GetTimeoutSec() float32

func (*HttpieExec) GetUseAuth

func (instance *HttpieExec) GetUseAuth() bool

func (*HttpieExec) GetUseCheckStatus

func (instance *HttpieExec) GetUseCheckStatus() bool

func (*HttpieExec) GetUseFollow

func (instance *HttpieExec) GetUseFollow() bool

func (*HttpieExec) GetUseSession

func (instance *HttpieExec) GetUseSession() bool

func (*HttpieExec) GetUseVerify

func (instance *HttpieExec) GetUseVerify() bool

func (*HttpieExec) GetUseVerifyAsYesNo

func (instance *HttpieExec) GetUseVerifyAsYesNo() string

func (*HttpieExec) GetUseWorkspace

func (instance *HttpieExec) GetUseWorkspace() bool

func (*HttpieExec) GetWorkPath

func (instance *HttpieExec) GetWorkPath(subPath string) (response string)

func (*HttpieExec) GetWorkspace

func (instance *HttpieExec) GetWorkspace() string

func (*HttpieExec) IsInstalled

func (instance *HttpieExec) IsInstalled() bool

func (*HttpieExec) LogDisableRotation

func (instance *HttpieExec) LogDisableRotation()

func (*HttpieExec) LogFlush

func (instance *HttpieExec) LogFlush()

func (*HttpieExec) PrintOptions

func (instance *HttpieExec) PrintOptions() string

func (*HttpieExec) SetAuthPsw

func (instance *HttpieExec) SetAuthPsw(value string) *HttpieExec

func (*HttpieExec) SetAuthType

func (instance *HttpieExec) SetAuthType(value string) *HttpieExec

SetAuthType set auth type. Supported types: basic, digest, bearer

func (*HttpieExec) SetAuthUser

func (instance *HttpieExec) SetAuthUser(value string) *HttpieExec

func (*HttpieExec) SetFollowAll

func (instance *HttpieExec) SetFollowAll(value bool) *HttpieExec

SetFollowAll enable/disable the follow of all redirects showing in response

func (*HttpieExec) SetFollowMax

func (instance *HttpieExec) SetFollowMax(value int) *HttpieExec

func (*HttpieExec) SetLogger

func (instance *HttpieExec) SetLogger(logger gg_log.ILogger) *HttpieExec

func (*HttpieExec) SetMaxRedirects

func (instance *HttpieExec) SetMaxRedirects(value int) *HttpieExec

func (*HttpieExec) SetPrintBody

func (instance *HttpieExec) SetPrintBody(value bool) *HttpieExec

func (*HttpieExec) SetPrintHeaders

func (instance *HttpieExec) SetPrintHeaders(value bool) *HttpieExec

func (*HttpieExec) SetPrintMeta

func (instance *HttpieExec) SetPrintMeta(value bool) *HttpieExec

func (*HttpieExec) SetRoot

func (instance *HttpieExec) SetRoot(dir string) *HttpieExec

SetRoot set the working root

func (*HttpieExec) SetSessionData

func (instance *HttpieExec) SetSessionData(value map[string]interface{}) *HttpieExec

func (*HttpieExec) SetTimeoutSec

func (instance *HttpieExec) SetTimeoutSec(value float32) *HttpieExec

func (*HttpieExec) SetUseAuth

func (instance *HttpieExec) SetUseAuth(value bool) *HttpieExec

SetUseAuth enable/disable authentication.

func (*HttpieExec) SetUseCheckStatus

func (instance *HttpieExec) SetUseCheckStatus(value bool) *HttpieExec

func (*HttpieExec) SetUseFollow

func (instance *HttpieExec) SetUseFollow(value bool) *HttpieExec

SetUseFollow enable/disable the follow of redirects

func (*HttpieExec) SetUseSession

func (instance *HttpieExec) SetUseSession(value bool) *HttpieExec

SetUseSession enable/disable session usage. Sessions are stored into ./session folder. You can create just 1 session per Exec that will be shared between all endpoints. If you need more session you have to create different Exec instances calling method httpie.NewExec(). All session data, including credentials, prompted passwords, cookie data, and custom headers are stored in plain text. That means session files can also be created and edited manually in a text editor—they are regular JSON. It also means that they can be read by anyone who has access to the session file. https://httpie.io/docs/cli/named-sessions

func (*HttpieExec) SetUseVerify

func (instance *HttpieExec) SetUseVerify(value bool) *HttpieExec

func (*HttpieExec) SetUseWorkspace

func (instance *HttpieExec) SetUseWorkspace(value bool) *HttpieExec

func (*HttpieExec) SetWorkspace

func (instance *HttpieExec) SetWorkspace(dir string) *HttpieExec

type HttpieHelper

type HttpieHelper struct {
	// contains filtered or unexported fields
}
var (
	HTTPie *HttpieHelper
)

func (*HttpieHelper) NewExec

func (instance *HttpieHelper) NewExec() *HttpieExec

NewExec Creates new HTTPie command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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