Skip to content
A simple transport to wrap other transport to add basic auth to requests
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
transport.go

README.md

basicauth-transport

A simple transport to wrap other transport to add basic auth to request.

Usage

package main

import (
	"github.com/ArthurHlt/basicauth-transport"
	"net/http"
)

func main() {
	
	http.DefaultClient.Transport = transport.NewDefaultBasicAuthTransport("username", "password")
	
	// with  a custom transport
	http.DefaultClient.Transport = transport.NewBasicAuthTransport(
		"username", 
		"password",
		&http.Transport{})
}
You can’t perform that action at this time.