httpclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package httpclient contains an http client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages making HTTP requests to the API.

func New

func New() *Client

New creates a new internal HTTP client.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string) (*http.Response, error)

Delete makes a DELETE request.

func (*Client) DeleteJSON added in v0.1.8

func (c *Client) DeleteJSON(ctx context.Context, path string, target any) error

DeleteJSON makes a DELETE request and intialises target with JSON response if not nil

func (*Client) Do added in v0.1.15

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, params any) (*http.Response, error)

Get makes a GET request.

func (*Client) GetJSON added in v0.1.8

func (c *Client) GetJSON(ctx context.Context, path string, params any, target any) error

GetJSON makes a GET request and intialises target with JSON response if not nil

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, body any) (*http.Response, error)

Post makes a POST request.

func (*Client) PostJSON added in v0.1.8

func (c *Client) PostJSON(ctx context.Context, path string, body any, target any) error

PostJSON makes a POST request and intialises target with JSON response if not nil

func (*Client) WithAPIKey added in v0.1.8

func (c *Client) WithAPIKey(key string) *Client

func (*Client) WithBaseURL added in v0.1.8

func (c *Client) WithBaseURL(baseURL string) *Client

WithBaseURL updates the base URL used for requests.

func (*Client) WithCookie added in v0.1.8

func (c *Client) WithCookie(cookie string) *Client

func (*Client) WithHeader added in v0.1.8

func (c *Client) WithHeader(key string, value string) *Client

func (*Client) WithUserAgent added in v0.1.8

func (c *Client) WithUserAgent(userAgent string) *Client

Jump to

Keyboard shortcuts

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