Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"bytes"
"io/ioutil"
"net/http"
"time"

"github.com/dapi-co/dapi-go/request"
)

func handleDapiRequest(body []byte, header http.Header) ([]byte, error) {
client := http.Client{}
client := http.Client{Timeout: 5 * time.Minute}

// create the request with the provided body
req, err := http.NewRequest("POST", request.BaseURL, bytes.NewBuffer(body))
Expand Down
3 changes: 2 additions & 1 deletion request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"io/ioutil"
"net/http"
"time"

"github.com/dapi-co/dapi-go/actions"
"github.com/dapi-co/dapi-go/types"
Expand All @@ -27,7 +28,7 @@ type BaseRequest struct {
// with the body of the request set as the provided body, and the headers as the
// provided headers.
func DapiRequest(body []byte, action actions.DapiAction) ([]byte, error) {
client := http.Client{}
client := http.Client{Timeout: 5 * time.Minute}

// unmarshal the body to a map, to add the action to it
bodyMap := make(map[string]interface{})
Expand Down