diff --git a/request.go b/request.go index 80cc5b2..7172419 100644 --- a/request.go +++ b/request.go @@ -15,7 +15,7 @@ type ValueProvider[T any] func() T type AuthProvider ValueProvider[string] type RequestBodyProvider func() (io.Reader, string) -func Request(mods ...RequestModifier) (*http.Request, error) { +func Request(mods ...RequestModifier) *http.Request { r := NewRequestBuilder() for _, mod := range mods { r = mod(r) diff --git a/request_builder.go b/request_builder.go index 3fbe140..90627b8 100644 --- a/request_builder.go +++ b/request_builder.go @@ -30,12 +30,12 @@ func NewRequestBuilderFromRequest(r *http.Request) *RequestBuilder { } } -func (b *RequestBuilder) Build() (*http.Request, error) { +func (b *RequestBuilder) Build() *http.Request { r, err := http.NewRequest(b.Method, b.URL.String(), b.Body) if err != nil { - return nil, err + return nil } r.Header = b.Header - return r, nil + return r }