httputil

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package httputil provides HTTP-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHeader

func DeleteHeader(headers map[string]string, name string) bool

DeleteHeader removes a header (case-insensitive) from a map[string]string. Returns true if the header was found and deleted, false otherwise.

func GetHeader

func GetHeader(headers map[string]string, name string) (string, bool)

GetHeader retrieves a header value case-insensitively from a map[string]string. Returns the value and true if found, or empty string and false if not found.

func GetHeaderFromSlice

func GetHeaderFromSlice(headers map[string][]string, name string) (string, bool)

GetHeaderFromSlice retrieves a header value case-insensitively from a map[string][]string. Returns the first value and true if found, or empty string and false if not found.

func HasHeader

func HasHeader(headers map[string]string, name string) bool

HasHeader checks if a header exists (case-insensitive) in a map[string]string.

func HasHeaderFromSlice

func HasHeaderFromSlice(headers map[string][]string, name string) bool

HasHeaderFromSlice checks if a header exists (case-insensitive) in a map[string][]string.

func SetHeader

func SetHeader(headers map[string]string, name, value string)

SetHeader sets a header value. If the header already exists (case-insensitive), it updates the existing key; otherwise, it adds a new entry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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