httputil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httputil provides HTTP helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBody

func AddBody(body any) func(*http.Request) (*http.Request, error)

AddBody marshals body into a request body when it is non-nil.

func AddHeaders

func AddHeaders(headers map[string]string, req *http.Request) *http.Request

AddHeaders adds the provided headers to a request.

func MakeGetRequestContextFunc

func MakeGetRequestContextFunc(ctx context.Context) func(*url.URL) (*http.Request, error)

MakeGetRequestContextFunc builds a GET request constructor for the given context.

func MakeHeadRequest

func MakeHeadRequest(ctx context.Context) func(*url.URL) (*http.Request, error)

MakeHeadRequest builds a HEAD request constructor for the given context.

func MakePostRequestContextFunc

func MakePostRequestContextFunc(ctx context.Context) func(*url.URL) (*http.Request, error)

MakePostRequestContextFunc builds a POST request constructor for the given context.

func MakeURL

func MakeURL(endpoint string, path string, query url.Values) result.Result[*url.URL]

MakeURL joins and parses an endpoint, path, and optional query string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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