Skip to content

Commit

Permalink
DE-1143 Use http constants (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc authored Dec 3, 2024
1 parent d6b1593 commit 1fdd82f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mailgun
import (
"context"
"fmt"
"net/http"
"time"

jsoniter "github.com/json-iterator/go"
Expand Down Expand Up @@ -163,7 +164,7 @@ func (ei *EventIterator) fetch(ctx context.Context, url string) error {
r.setClient(ei.mg.Client())
r.setBasicAuth(basicAuthUser, ei.mg.APIKey())

resp, err := makeRequest(ctx, r, "GET", nil)
resp, err := makeRequest(ctx, r, http.MethodGet, nil)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (mg *MailgunImpl) GetExportLink(ctx context.Context, id string) (string, er

r.addHeader("User-Agent", MailgunGoUserAgent)

req, err := r.NewRequest(ctx, "GET", nil)
req, err := r.NewRequest(ctx, http.MethodGet, nil)
if err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func buildFormRequest(fields map[string]string) *http.Request {
}

r := strings.NewReader(values.Encode())
req, _ := http.NewRequest("POST", "/", r)
req, _ := http.NewRequest(http.MethodPost, "/", r)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

return req
Expand All @@ -157,7 +157,7 @@ func buildMultipartFormRequest(fields map[string]string) *http.Request {

writer.Close()

req, _ := http.NewRequest("POST", "/", buf)
req, _ := http.NewRequest(http.MethodPost, "/", buf)
req.Header.Set("Content-type", writer.FormDataContentType())

return req
Expand Down

0 comments on commit 1fdd82f

Please sign in to comment.