# README
OpenURI
Usage
Open the file.
o, err := uri.Open("/path/to/file")
Open the URL.
o, err := uri.Open("http://localhost")
with Google App Engine
o, err := uri.Open("http://localhost", uri.WithHTTPClient(urlfetch.Client(ctx)))
Example
//
// Open a local file
//
o, err := uri.Open("/path/to/file")
if err != nil {
log.Fatal(err)
}
defer o.Close()
b, _ := ioutil.ReadAll(o)
log.Println(string(b))
//
// Open URL
//
o, err = uri.Open("http://localhost")
if err != nil {
log.Fatal(err)
}
defer o.Close()
b, _ = ioutil.ReadAll(o)
log.Println(string(b))
# Functions
New returns a Client.
Open opens an io.ReadCloser from a local file or URL.
WithHttpClient returns a ClientOption that sets the http.Client.
# Type aliases
ClientOption type.