Skip to content

Commit

Permalink
Fixed getting data
Browse files Browse the repository at this point in the history
  • Loading branch information
liderman committed May 19, 2017
1 parent 4031196 commit 7863d18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yandex-rasp-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ type HttpDataFetcher struct{}

func (d *HttpDataFetcher) Fetch(url string) (resp io.ReadCloser, err error) {
req, err := http.NewRequest("GET", url, nil)
req.Header.Set("Accept-Encoding", "gzip, deflate")
if err != nil {
return
}
client := &http.Client{}
httpResp, err := client.Do(req)
if err != nil {
return
}

resp = req.Body
resp = httpResp.Body
return
}

Expand Down

0 comments on commit 7863d18

Please sign in to comment.