http

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func New

func New() *Builder

func (*Builder) AddHeader

func (b *Builder) AddHeader(name, value string, line, col int)

func (*Builder) AppendBodyLine

func (b *Builder) AppendBodyLine(no int, text, term string)

func (*Builder) BodyFromFile

func (b *Builder) BodyFromFile() string

func (*Builder) BodyLines added in v1.7.0

func (b *Builder) BodyLines() []int

func (*Builder) BodyText

func (b *Builder) BodyText() string

BodyText rebuilds the body with its original line endings. The final line ending is not part of the body.

func (*Builder) HasMethod

func (b *Builder) HasMethod() bool

func (*Builder) HeaderDone

func (b *Builder) HeaderDone() bool

func (*Builder) HeaderLines added in v1.7.0

func (b *Builder) HeaderLines() []restfile.HeaderLine

func (*Builder) HeaderMap

func (b *Builder) HeaderMap() stdhttp.Header

func (*Builder) Headers

func (b *Builder) Headers() stdhttp.Header

func (*Builder) MarkHeadersDone

func (b *Builder) MarkHeadersDone()

func (*Builder) Method

func (b *Builder) Method() string

func (*Builder) MimeType

func (b *Builder) MimeType() string

func (*Builder) SetBodyFromFile

func (b *Builder) SetBodyFromFile(path string)

func (*Builder) SetMethodAndURL

func (b *Builder) SetMethodAndURL(method, url string)

func (*Builder) SetURLPos added in v1.7.0

func (b *Builder) SetURLPos(line, col int)

func (*Builder) URL

func (b *Builder) URL() string

func (*Builder) URLPos added in v1.7.0

func (b *Builder) URLPos() (line, col int)

type MethodLine added in v1.2.4

type MethodLine struct {
	Method  string
	URL     string
	Version version.HTTP
}

MethodLine contains the parsed parts of a request line.

func ParseMethodLine

func ParseMethodLine(line string) (ml MethodLine, ok bool, err error)

ParseMethodLine parses an HTTP request line.

func ParseRequestLine added in v1.2.4

func ParseRequestLine(line string) (MethodLine, bool, error)

ParseRequestLine parses a method request or a bare HTTP/WebSocket URL.

func ParseWebSocketURLLine

func ParseWebSocketURLLine(line string) (MethodLine, bool, error)

ParseWebSocketURLLine parses a bare WebSocket request line.

Jump to

Keyboard shortcuts

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