http

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 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 http provides utilities for creating HTTP requests with Either-based error handling.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PostRequest creates a POST HTTP request with a body.
	// Usage: PostRequest(url)(body) returns Either[error, *http.Request]
	//
	// Example:
	//
	//	request := http.PostRequest("https://api.example.com/data")([]byte(`{"key":"value"}`))
	PostRequest = bodyRequest("POST")

	// PutRequest creates a PUT HTTP request with a body.
	// Usage: PutRequest(url)(body) returns Either[error, *http.Request]
	PutRequest = bodyRequest("PUT")

	// GetRequest creates a GET HTTP request without a body.
	// Usage: GetRequest(url) returns Either[error, *http.Request]
	//
	// Example:
	//
	//	request := http.GetRequest("https://api.example.com/data")
	GetRequest = noBodyRequest("GET")

	// DeleteRequest creates a DELETE HTTP request without a body.
	// Usage: DeleteRequest(url) returns Either[error, *http.Request]
	DeleteRequest = noBodyRequest("DELETE")

	// OptionsRequest creates an OPTIONS HTTP request without a body.
	// Usage: OptionsRequest(url) returns Either[error, *http.Request]
	OptionsRequest = noBodyRequest("OPTIONS")

	// HeadRequest creates a HEAD HTTP request without a body.
	// Usage: HeadRequest(url) returns Either[error, *http.Request]
	HeadRequest = noBodyRequest("HEAD")
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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