rest

package
v0.0.0-...-b4c633b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSON

func EncodeJSON(data any) ([]byte, error)

func GetJSONPATH

func GetJSONPATH(input string, path string) (interface{}, error)

func IsJSON

func IsJSON(s string) bool

func ParseJSON

func ParseJSON(text string) (map[string]any, error)

func PrettyJSON

func PrettyJSON(data []byte) (string, error)

Types

type Response

type Response struct {
	StatusCode int
	Headers    map[string]string
	Cookies    []*http.Cookie
	Body       []byte

	TimePassed time.Duration

	IsJSON bool
	JSON   string
}

type Service

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

func New

func New(requests *state.Requests, environments *state.Environments) *Service

func (*Service) SendRequest

func (s *Service) SendRequest(requestID, activeEnvironmentID string) (*Response, error)

Jump to

Keyboard shortcuts

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