# Functions
CompressionTypeString retrieves an enum value from the enum constants string name.
CompressionTypeValues returns all values of the enum.
MakeBatchRequests concurrently makes multiple requests.
MakeRequest makes http request for tor the provided ParsedHTTPRequest.
NewK6Error is the constructor for K6Error.
NewResponse returns an empty Response instance.
NewURL returns a new URL for the provided url and name.
ResponseTypeString retrieves an enum value from the enum constants string name.
ResponseTypeValues returns all values of the enum.
SetRequestCookies sets the cookies of the requests getting those cookies both from the jar and from the reqCookies map.
ToURL tries to convert anything passed to it to a k6 URL struct.
# Constants
CompressionTypeBr compresses through brotli.
CompressionTypeDeflate compresses through flate.
CompressionTypeGzip compresses through gzip.
CompressionTypeZstd compresses through zstd.
ResponseTypeBinary causes k6 to return the response body as a []byte, suitable for working with binary files without lost data and needless string conversions.
ResponseTypeNone causes k6 to fully read the response body while immediately discarding the actual data - k6 would set the body of the returned HTTPResponse to null.
ResponseTypeText causes k6 to return the response body as a string.
# Structs
BatchParsedHTTPRequest extends the normal parsed HTTP request with a pointer to a Response object, so that the batch goroutines can concurrently store the responses they receive, without any locking.
HTTPCookie is a representation of an http cookies used in the Response object.
HTTPRequestCookie is a representation of a cookie used for request objects.
K6Error is a helper struct that enhances Go errors with custom k6-specific error-codes and more user-readable error messages.
ParsedHTTPRequest a represantion of a request after it has been parsed from a user script.
Request represent an http request.
Response is a representation of an HTTP response.
ResponseTimings is a struct to put all timings for a given HTTP response/request.
A Tracer wraps "net/http/httptrace" to collect granular timings for HTTP requests.
A Trail represents detailed information about an HTTP request.
A URL wraps net.URL, and preserves the template (if any) the URL was constructed from.
# Type aliases
CompressionType is used to specify what compression is to be used to compress the body of a request The conversion and validation methods are auto-generated with https://github.com/alvaroloes/enumer:
go:generate enumer -type=CompressionType -transform=snake -trimprefix CompressionType -output compression_type_gen.go.
ResponseType is used in the request to specify how the response body should be treated The conversion and validation methods are auto-generated with https://github.com/alvaroloes/enumer:
go:generate enumer -type=ResponseType -transform=snake -json -text -trimprefix ResponseType -output response_type_gen.go.