Skip to content

A simple transport to wrap other transport to add basic auth to requests

License

Notifications You must be signed in to change notification settings

ArthurHlt/basicauth-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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{})
}

About

A simple transport to wrap other transport to add basic auth to requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages