Registry / serialization / mozillazg-go-httpheader

mozillazg-go-httpheader

JSON →
library0.4.0gogounverified

Package httpheader implements encoding of structs into http.Header fields.

go get github.com/mozillazg/go-httpheader
INSTALL
IMPORT
SIG · MOZILLAZG-GO-HTTPH
M
mozillazg-go-httpheader
serializationgov0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

httpheader
github.com/mozillazg/go-httpheader

Encode a struct into http.Header fields

package main import ( "fmt" "net/http" "github.com/mozillazg/go-httpheader" ) type Options struct { ContentType string `header:"Content-Type"` Auth string `header:"Authorization"` } func main() { opts := Options{ContentType: "application/json", Auth: "Bearer token"} h := http.Header{} httpheader.Header(&h, opts) fmt.Println(h) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.4.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
mozillazg-go-httpheader — go get mozillazg-go-httpheader · libregistry