restapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestAPI

type RestAPI struct {
	APIKey  string
	BaseURL string
	Client  *http.Client
}

RestAPI struct to handle the HTTP Requests

func NewRestAPI

func NewRestAPI(apiKey, baseURL string) *RestAPI

func (*RestAPI) Delete

func (api *RestAPI) Delete(url string) (*http.Response, error)

func (*RestAPI) Get

func (api *RestAPI) Get(url string) (*http.Response, error)

GET request

func (*RestAPI) Headers

func (api *RestAPI) Headers() http.Header

func (*RestAPI) Patch

func (api *RestAPI) Patch(url string, data interface{}) (*http.Response, error)

func (*RestAPI) Post

func (api *RestAPI) Post(url string, data interface{}) (*http.Response, error)

Jump to

Keyboard shortcuts

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