http

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPS_SCHEME = "https://"

	DeviceIDKey       = "deviceID"
	ResourceHrefKey   = "resourceHref"
	SubscriptionIDKey = "subscriptionID"

	ContentQueryKey = "content"
)

Variables

This section is empty.

Functions

func DoHTTPRequest

func DoHTTPRequest(t *testing.T, req *http.Request) *http.Response

func ReadHTTPResponse

func ReadHTTPResponse(t *testing.T, w io.Reader, contentType string, data interface{})

Types

type HTTPRequestBuilder

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

func NewHTTPRequest

func NewHTTPRequest(method, url string, body io.Reader) *HTTPRequestBuilder

func (*HTTPRequestBuilder) Accept

func (c *HTTPRequestBuilder) Accept(accept string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) AddContentQuery

func (c *HTTPRequestBuilder) AddContentQuery(content string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) AddQuery

func (c *HTTPRequestBuilder) AddQuery(key string, value ...string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) AuthToken

func (c *HTTPRequestBuilder) AuthToken(token string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) Build

func (c *HTTPRequestBuilder) Build(ctx context.Context, t *testing.T) *http.Request

func (*HTTPRequestBuilder) DeviceId

func (c *HTTPRequestBuilder) DeviceId(deviceID string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) ResourceHref

func (c *HTTPRequestBuilder) ResourceHref(resourceHref string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) SetQuery

func (c *HTTPRequestBuilder) SetQuery(value string) *HTTPRequestBuilder

func (*HTTPRequestBuilder) SubscriptionID

func (c *HTTPRequestBuilder) SubscriptionID(subscriptionID string) *HTTPRequestBuilder

Jump to

Keyboard shortcuts

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