response

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	UniqueIdentifier string                  // Internally generated UUID for the request
	URL              string                  // URL of the request
	Method           string                  // HTTP method of the request
	RequestPayload   []byte                  // Payload of the request
	Options          request.Options         // Additional options for the request
	RequestTime      int64                   // The time when the request was made
	ResponseTime     int64                   // The time when the response was received
	Status           string                  // Status of the HTTP response
	StatusCode       int                     // HTTP status code of the response
	Proto            string                  // HTTP protocol used
	Header           http.Header             // HTTP headers of the response
	ContentLength    int64                   // Content length from the response
	TransferEncoding []string                // Transfer encoding of the response
	CompressionType  request.CompressionType // Type of compression
	Uncompressed     bool                    // Was the response compressed - https://pkg.go.dev/net/http#Response.Uncompressed
	Cookies          []*http.Cookie          // Cookies received in the response
	AccessTime       time.Duration           // Time taken to complete the request
	Body             bytes.Buffer            // Response body as bytes
	Error            error                   // Error encountered during the request
	TLS              *tls.ConnectionState    // TLS connection state
	Redirected       bool                    // Was the request redirected
	Location         string                  // If redirected, what was the location
}

Response represents the HTTP response along with additional details.

func (*Response) Bytes

func (r *Response) Bytes() []byte

Bytes is a helper function to get the underlying bytes.Buffer []byte

func (*Response) Length added in v0.4.0

func (r *Response) Length() int

func (*Response) String

func (r *Response) String() string

String is a helper function to get the underlying bytes.Buffer string

Jump to

Keyboard shortcuts

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