requestbuilder

package
v0.0.0-...-7a76d2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestBuilder

type RequestBuilder struct {
	// contains filtered or unexported fields
}

RequestBuilder helps build and execute HTTP requests.

func NewRequestBuilder

func NewRequestBuilder(method, url string) *RequestBuilder

NewRequestBuilder creates a new instance of RequestBuilder.

func (*RequestBuilder) Execute

func (rb *RequestBuilder) Execute() (*http.Response, error)

Execute sends the request and returns the response.

func (*RequestBuilder) WithContext

func (rb *RequestBuilder) WithContext(ctx context.Context) *RequestBuilder

WithContext sets the context for the request.

func (*RequestBuilder) WithHeader

func (rb *RequestBuilder) WithHeader(key, value string) *RequestBuilder

WithHeader adds a header to the request.

func (*RequestBuilder) WithJSONBody

func (rb *RequestBuilder) WithJSONBody(data interface{}) *RequestBuilder

WithJSONBody sets a JSON body for the request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL