Massive graphical overhaul

This commit is contained in:
2018-01-07 21:42:19 +01:00
parent 9a4eddcbd1
commit 636643c9e0
44 changed files with 600 additions and 548 deletions

View File

@@ -2,8 +2,9 @@ package pixelapi
import "net/http"
import "io/ioutil"
import "io"
func get(url string) (string, error) {
func getString(url string) (string, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return "", err
@@ -22,3 +23,19 @@ func get(url string) (string, error) {
return string(bodyBytes), err
}
func getRaw(url string) (io.ReadCloser, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, err
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
return resp.Body, err
}