http

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 5 Imported by: 2

README

HTTP

Static Badge Build Go Reference codecov Release Go Report Card FOSSA Status License

http package provides tooling around http in Go, configured for production usage. The testify package provide somes tools for configure correctly your unit tests with the http call(s).

Install

$> go get github.com/gofast-pkg/http@latest

Usage

// for the application usage
package main

import "github.com/gofast-pkg/http"

func main() {
  client := http.NewClient()

  // do something with your net/http client
}
// for the unit tests usage
package main

import "github.com/gofast-pkg/http/testify"

func main() {
  client := testify.NewHTTPClient()

  // do something with your net/http client
  // read documentation for more details
}

Contributing

 ❕  Use issues for everything

Read more informations with the CONTRIBUTING_GUIDE

For all changes, please update the CHANGELOG.txt file by replacing the existant content.

Thank you  🙏  👍 

Made with contrib.rocks.

Licence

MIT

Documentation

Overview

Package http provides tooling around http in Go configured for production usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() *http.Client

NewClient returns a new http client configured for production usage.

func UnexpectedResponseBody added in v0.2.0

func UnexpectedResponseBody(resp *http.Response) (message string)

UnexpectedResponseBody return the content body in string format. The function close the body. Use this fonction to log data when an unexpected response occurred.

Types

This section is empty.

Directories

Path Synopsis
Package testify provide a tool to mock http calls.
Package testify provide a tool to mock http calls.

Jump to

Keyboard shortcuts

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