forked from toolshed/abra
@ -3,7 +3,6 @@ package web
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -13,7 +12,7 @@ const Timeout = 10 * time.Second
|
||||
|
||||
// ReadJSON reads JSON and parses it into your chosen interface pointer
|
||||
func ReadJSON(url string, target interface{}) error {
|
||||
httpClient := &http.Client{Timeout: Timeout}
|
||||
httpClient := NewHTTPRetryClient()
|
||||
res, err := httpClient.Get(url)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user