curl

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 5 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
	DigestAuth        bool
	AWSSigv4          string
	Bearer            string
	FormFields        []formField
	UploadFile        string
	Head              bool
	Insecure          bool
	ECH               string
	Output            string
	RemoteName        bool
	RemoteHeaderName  bool
	FollowRedirects   bool
	MaxRedirects      int
	MaxRedirectsSet   bool
	Timeout           float64
	TimeoutSet        bool
	ConnectTimeout    float64
	ConnectTimeoutSet bool
	Proxy             string
	DoHURL            string
	HTTPVersion       string
	TLSMaxVersion     string
	TLSVersion        string
	CACert            string
	Cert              string
	Key               string
	UnixSocket        string
	Ranges            []string
	Retry             int
	RetrySet          bool
	RetryDelay        float64
	RetryDelaySet     bool
	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"
	// contains filtered or unexported fields
}

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