Documentation
¶
Overview ¶
Copyright 2023 Christopher Briscoe. All rights reserved.
Copyright 2023 Christopher Briscoe. All rights reserved.
Copyright 2023 Christopher Briscoe. All rights reserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("404 not found")
ErrNotFound is returned when the response status is 404 Status Not Found
Functions ¶
func GetIP ¶
GetIP will first try to get proxy IP headers in case the server is running behind a reverse proxy. Otherwise, just use the http.Request.RemoteAddr with the port stripped.
func GetRequestParams ¶
GetRequestParams splits off the preferrend encoding from the request keys
func SetPreferredEncoding ¶
func SetPreferredEncoding(w http.ResponseWriter, r *http.Request)
SetPreferredEncoding will default to using BR compression if the client accepts that encoding. Otherwise, use GZIP.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an http client
func (*Client) SetTimeout ¶
SetTimeout sets the network timeout of the request