parser

package
v0.0.0-...-0d3f7e8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterWithChunkEncoding

func FilterWithChunkEncoding(body []byte) (bodyTE []byte, residueB []byte)

Parse the body according to chunk encoding

func FilterWithContentLength

func FilterWithContentLength(contentLength int, body []byte) (bodyCL []byte, residueB []byte, difference int)

Parse the body according to Content-Length Header

func ParseRequest

func ParseRequest(reader *bufio.Reader) (httpHeader http.Header, bodyB []byte, err error)

Parse a request to retrieve headers and body

func ParseRequestWithoutPrint

func ParseRequestWithoutPrint(reader *bufio.Reader) (request request.Request, err error)

Parse a request to retrieve headers and body but do not print any information

func ParseResponse

func ParseResponse(reqMethod string, url string, resp string) (response response.Response, err error)

ParseResponse: parse an HTTP response to retrieve the status line, the header field and the body

func ParseUrl

func ParseUrl(url string) (tls bool, addr string)

ParseURl: parse an url to retreive protocol and address

func ReplaceSpecialCharacters

func ReplaceSpecialCharacters(rawWithSpecial []byte) (strWithoutSpecial string)

ReplaceSpecialCharacters: replace special characters in a given string (bytes) to make them visible

Types

This section is empty.

Jump to

Keyboard shortcuts

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