rest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MPL-2.0 Imports: 1 Imported by: 3

Documentation

Overview

Package rest provides useful types and funcitons for working with REST APIs.

TODO(rest): Should this be moved to a REST specification?

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequest

type HTTPRequest struct {
	Method  string         `json:"method"`
	Headers http.Header    `json:"headers"`
	Body    map[string]any `json:"body"`
}

HTTPRequest holds details about a HTTP request. This type is used across all integrations that communicate with an HTTP API for consistency.

type HTTPResponse

type HTTPResponse struct {
	StatusCode int            `json:"status,omitempty"`
	Headers    http.Header    `json:"headers,omitempty"`
	Body       map[string]any `json:"body,omitempty"`
}

HTTPResponse holds details about a HTTP response. This type is used across all integrations that communicate with an HTTP API for consistency.

Jump to

Keyboard shortcuts

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