http

package
v2.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

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

	IDKey              = "id"
	IDFilterKey        = "idFilter"
	DeviceIDKey        = "deviceID"
	ResourceHrefKey    = "resourceHref"
	SubscriptionIDKey  = "subscriptionID"
	ConfigurationIDKey = "configurationId"
	VersionKey         = "version"

	ContentQueryKey = "content"
)

Variables

This section is empty.

Functions

func Do added in v2.19.1

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

func GetContentData added in v2.19.1

func GetContentData(content *pb.Content, desiredContentType string) ([]byte, error)

func ReadResponse added in v2.19.1

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

func Unmarshal added in v2.19.1

func Unmarshal(code int, input io.Reader, v protoreflect.ProtoMessage) error

func UnmarshalError added in v2.19.1

func UnmarshalError(data []byte) error

func UnmarshalJson added in v2.19.1

func UnmarshalJson(code int, input io.Reader, v any) error

Types

type Decoder added in v2.19.1

type Decoder = interface {
	Decode(interface{}) error
}

type RequestBuilder added in v2.19.1

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

func NewRequest added in v2.19.1

func NewRequest(method, url string, body io.Reader) *RequestBuilder

func (*RequestBuilder) Accept added in v2.19.1

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

func (*RequestBuilder) AddContentQuery added in v2.19.1

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

func (*RequestBuilder) AddQuery added in v2.19.1

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

func (*RequestBuilder) AuthToken added in v2.19.1

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

func (*RequestBuilder) Build added in v2.19.1

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

func (*RequestBuilder) ContentType added in v2.19.1

func (c *RequestBuilder) ContentType(contentType string) *RequestBuilder

func (*RequestBuilder) DeviceId added in v2.19.1

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

func (*RequestBuilder) ID added in v2.21.0

func (*RequestBuilder) IDFilter added in v2.21.0

func (c *RequestBuilder) IDFilter(idFilter []string) *RequestBuilder

func (*RequestBuilder) ResourceHref added in v2.19.1

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

func (*RequestBuilder) SetQuery added in v2.19.1

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

func (*RequestBuilder) SubscriptionID added in v2.19.1

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

func (*RequestBuilder) Version added in v2.21.0

func (c *RequestBuilder) Version(version string) *RequestBuilder

Jump to

Keyboard shortcuts

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