request

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidContentType = fmt.Errorf("not a valid ContentType, try [%s]", strings.Join(_ContentTypeNames, ", "))

Functions

func ContentTypeNames

func ContentTypeNames() []string

ContentTypeNames returns a list of possible string values of ContentType.

func Send

func Send[T any](c *http.Client, req *http.Request, contentType ContentType) (*T, *http.Response, error)

Types

type ContentType

type ContentType string

ContentType ENUM(application/json=0)

const (
	// ContentTypeApplicationJson is a ContentType of type application/json.
	ContentTypeApplicationJson ContentType = "application/json"
)

func ParseContentType

func ParseContentType(name string) (ContentType, error)

ParseContentType attempts to convert a string to a ContentType.

func (ContentType) IsValid

func (x ContentType) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (ContentType) MarshalText

func (x ContentType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (ContentType) String

func (x ContentType) String() string

String implements the Stringer interface.

func (*ContentType) UnmarshalText

func (x *ContentType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

Jump to

Keyboard shortcuts

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