Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DE-1143 Use http constants #356

Merged
merged 2 commits into from
Dec 3, 2024
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 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
Loading