httpx

package
v0.0.0-...-13e2633 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHost = ""

Functions

func BaseURL

func BaseURL(ctx context.Context) *url.URL

BaseURL returns the "base" url for this request, defined as a url containing the Host and Scheme portions of the request uri.

func ClientContext

func ClientContext(parent context.Context, client *http.Client) context.Context

ClientContext binds the provided client to a new context derived from the provided parent. Use httpx.ClientFromContext to retrieve the client at some later point.

func ClientFromContext

func ClientFromContext(ctx context.Context) *http.Client

ClientFromContext retrieves a http.Client that has been bound to this context previously by a call to httpx.ClientContext, defaulting to a default Client if none has been bound

func Host

func Host(ctx context.Context) string

func RequestContext

func RequestContext(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context

RequestContext returns a context representing the provided http action.

func RequestFromContext

func RequestFromContext(ctx context.Context) *http.Request

Types

This section is empty.

Jump to

Keyboard shortcuts

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