https

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package https provides a unified HTTP client for making API requests with centralized auth, error handling, and debug logging.

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 is a unified HTTP client for API requests.

func NewClient

func NewClient(apiKey, apiURL string, log logger.Logger) *Client

NewClient creates a new HTTP client with the given credentials.

func NewWrappedClient added in v0.0.2

func NewWrappedClient(apiKey, apiURL string, httpClient *http.Client, log logger.Logger) *Client

NewWrappedClient creates a new HTTP client with a custom http.Client. This is useful for tests that need to wrap the HTTP client (e.g., with VCR).

func (*Client) DELETE

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

DELETE makes a DELETE request.

func (*Client) GET

func (c *Client) GET(ctx context.Context, path string, params map[string]string) (*http.Response, error)

GET makes a GET request with query parameters.

func (*Client) POST

func (c *Client) POST(ctx context.Context, path string, body interface{}) (*http.Response, error)

POST makes a POST request with a JSON body.

Jump to

Keyboard shortcuts

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