Skip to content

Instantly share code, notes, and snippets.

@shindakun
Created February 6, 2018 02:54
Show Gist options
  • Save shindakun/bd6a9a6142529e76704250ffc414fd3b to your computer and use it in GitHub Desktop.
Save shindakun/bd6a9a6142529e76704250ffc414fd3b to your computer and use it in GitHub Desktop.
// Without the protocol it will throw the following:
// $ go run main.go
// Get podcasts.files.bbci.co.uk/b006qtl3.rss: unsupported protocol scheme ""
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
resp, err := http.Get("http://podcasts.files.bbci.co.uk/b006qtl3.rss")
if err != nil {
fmt.Println(err)
}
body, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
fmt.Println(err)
}
fmt.Println(string(body))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment