# README
fetch -- Fetch Data from URL
This package is required Go 1.16 or later.
Migrated repository to github.com/goark/fetch
Import
import "github.com/goark/fetch"
Usage
package main
import (
"context"
"fmt"
"io"
"os"
"github.com/goark/fetch"
)
func main() {
u, err := fetch.URL("https://github.com/spiegel-im-spiegel.gpg")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return
}
resp, err := fetch.New().GetWithContext(context.Background(), u)
if err != nil {
fmt.Fprintln(os.Stderr, err)
return
}
defer resp.Close()
if _, err := io.Copy(os.Stdout, resp.Body()); err != nil {
fmt.Fprintln(os.Stderr, err)
}
}
Modules Requirement Graph
# Functions
New function returns Client instance.
URL function returns url.URL instance from string.
WithProtocol returns function for setting context.Context.
WithProtocol returns function for setting http.Client.
WithRequestHeaderAdd returns function for adding request header in http.Request.
WithRequestHeaderSet returns function for setting request header in http.Request.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author