Skip to content

Golang library to bind HTTP headers into struct values.

License

Notifications You must be signed in to change notification settings

dennisstritzke/httpheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

HTTP Header

Golang library to bind HTTP headers into struct values.

Example

package main

import (
	"fmt"
	"github.com/dennisstritzke/httpheader"
	"net/http"
)

type GitHubResponse struct {
	Date string `header:"Date"`
}

func main() {
	resp, _ := http.Get("https://github.com/")

	var githubResponse GitHubResponse
	err := httpheader.Bind(resp.Header, &githubResponse)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("Date: %s\n", githubResponse.Date)
}

About

Golang library to bind HTTP headers into struct values.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages