Categorygithub.com/caelisco/http-client
modulepackage
0.4.2
Repository: https://github.com/caelisco/http-client.git
Documentation: pkg.go.dev

# README

http-client

A small wrapper around the HTTP Client in Go.

The client is not necessarily feature complete and is designed to work with simple requests to an HTTP server.

It has two modes of operation:

  1. Normal HTTP method function calls
  2. A reusable client

In most cases, the HTTP method function calls are probably what you are looking for.

The reusable client is typically more useful in scenarios where you need to work with cookies, or in scenarios where it will be useful to keep track of past requests. An example could be for writing an API test that might require different headers/cookies to be set and used as part of the testing of each end point.

HTTP method calls use the http.DefaultClient, while the reusable client establishes its own internal *http.Client or you can configure your own *http.Client which can be used within the reusable client.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Connect performs an HTTP CONNECT to the specified URL.
Custom performs a custom HTTP method to the specified URL with the given payload.
Delete performs an HTTP DELETE to the specified URL.
FormPost performs an HTTP POST as an x-www-form-urlencoded payload to the specified URL.
Get performs an HTTP GET to the specified URL.
Head performs an HTTP HEAD to the specified URL.
New returns a reusable Client.
NewCustom returns a reusable client with a custom defined *http.Client This is useful in scenarios where you want to change any configurations for the http.Client.
Options performs an HTTP OPTIONS to the specified URL.
Patch performs an HTTP PATCH to the specified URL with the given payload.
Post
Post performs an HTTP POST to the specified URL with the given payload.
Put performs an HTTP PUT to the specified URL with the given payload.
Trace performs an HTTP TRACE to the specified URL.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Client represents an HTTP client.
No description provided by the author

# Type aliases

Alias to request.Options.
Alias to response.Response.