curl

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAllowedProto

func ParseAllowedProto(value string) (bool, bool)

ParseAllowedProto parses a curl --proto value and returns which protocols are allowed. Curl syntax: "=https" means only HTTPS; "http,https" or "+http" adds to defaults; "-http" removes from defaults. Returns (allowHTTP, allowHTTPS).

Types

type DataValue

type DataValue struct {
	Value       string
	IsRaw       bool // No @file expansion.
	IsURLEncode bool // URL-encode the value (or file contents for @file/name@file forms).
}

DataValue represents a single data value with flags indicating how the value should be processed.

type Result

type Result struct {
	URL              string
	Method           string
	Headers          []header
	DataValues       []DataValue
	BasicAuth        string
	AWSSigv4         string
	Bearer           string
	FormFields       []formField
	UploadFile       string
	Head             bool
	Insecure         bool
	Output           string
	RemoteName       bool
	RemoteHeaderName bool
	FollowRedirects  bool
	MaxRedirects     int
	Timeout          float64
	ConnectTimeout   float64
	Proxy            string
	DoHURL           string
	HTTPVersion      string
	TLSVersion       string
	CACert           string
	Cert             string
	Key              string
	UnixSocket       string
	Ranges           []string
	Retry            int
	RetryDelay       float64
	GetFlag          bool
	Verbose          int
	Silent           bool
	UserAgent        string
	Referer          string
	Cookie           string
	HasContentType   bool
	HasAccept        bool
	AllowedProto     string // raw --proto value, e.g. "=https" or "http,https"
}

Result is the intermediate representation of a parsed curl command.

func Parse

func Parse(command string) (*Result, error)

Parse parses a curl command string and returns a Result.

Jump to

Keyboard shortcuts

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