Help us shape the future of Go! Take the 2026 Go Developer Survey

http

package
v2.3.20 Latest Latest
Warning

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

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

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