Categorygithub.com/gofika/httputil
repositorypackage
0.0.0-20241209191153-ccdca6be7cb8
Repository: https://github.com/gofika/httputil.git
Documentation: pkg.go.dev

# README

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)
}