Skip to content

Commit

Permalink
Use default http client (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
duhruh authored Mar 10, 2021
1 parent 9410002 commit b803c13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions huego.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func get(ctx context.Context, url string) ([]byte, error) {

req = req.WithContext(ctx)

client := http.Client{}
client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return nil, err
Expand Down Expand Up @@ -124,7 +124,7 @@ func put(ctx context.Context, url string, data []byte) ([]byte, error) {

req.Header.Set(contentType, applicationJSON)

client := http.Client{}
client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return nil, err
Expand Down Expand Up @@ -154,7 +154,7 @@ func post(ctx context.Context, url string, data []byte) ([]byte, error) {

req.Header.Set(contentType, applicationJSON)

client := http.Client{}
client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return nil, err
Expand Down Expand Up @@ -182,7 +182,7 @@ func delete(ctx context.Context, url string) ([]byte, error) {

req.Header.Set(contentType, applicationJSON)

client := http.Client{}
client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return nil, err
Expand Down Expand Up @@ -216,7 +216,7 @@ func DiscoverAllContext(ctx context.Context) ([]Bridge, error) {

req = req.WithContext(ctx)

client := http.Client{}
client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return nil, err
Expand Down

0 comments on commit b803c13

Please sign in to comment.