Skip to content

gofika/httputil

Repository files navigation

codecov Build Status go.dev Go Report Card Licenses

httputil

golang http utils for common use

Basic Usage

Installation

To get the package, execute:

go get github.com/gofika/httputil

Example

package main

import (
	"fmt"

	"github.com/gofika/httputil"
)

func main() {
	resp, err := httputil.Get("https://httpbin.org/get")
	if err != nil {
		panic(err)
	}
	type GetResp struct {
		URL string `json:"url"`
	}
	res, err := httputil.ReadJSON[GetResp](resp)
	fmt.Printf("url=%s\n", res.URL)
}

About

golang http utils for common use

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages