chttp

package
v2.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package chttp provides some convenience function to wrap the standard http Client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCookies

func ConvertCookies(cc []http.Cookie) []*http.Cookie

func New

func New(cookieDomain string, cookies []*http.Cookie, rt http.RoundTripper) *http.Client

New inits the HTTP client with cookies.

func NewWithToken

func NewWithToken(token string, cookieDomain string, cookies []*http.Cookie) *http.Client

NewWithToken returns the HTTP client with cookies, that augments requests with slack token.

Types

type Transport

type Transport struct {
	BeforeReq func(req *http.Request)
	AfterReq  func(resp *http.Response, req *http.Request)
	// contains filtered or unexported fields
}

a simple wrapper for http.RoundTripper to do something before and after RoundTrip

func NewTransport

func NewTransport(tr http.RoundTripper) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

Jump to

Keyboard shortcuts

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