func MakeFromHTTPRequest(r *http.Request, publicBaseURL string) (*AuthRequest, error) {
	credentials := make(map[string]string)
	for key, value := range r.Header {
		credentials[strings.ToLower(key)] = value[0]
	}

	content, err := commons.ReadRequestBody(r)
	if err != nil {
		return nil, err
	}

	path, err := url.QueryUnescape(r.URL.RequestURI())
	if err != nil {
		return nil, err
	}

	return &AuthRequest{
		Credentials: credentials,
		Content:     content,
		Method:      r.Method,
		URL:         buildURL(publicBaseURL, path),
	}, nil
}
// MakeFromHTTPRequest generates a AuthRequest from a http.Request
MakeFromHTTPRequest generates a AuthRequest from a http.Request
// MakeFromHTTPRequest generates a AuthRequest from a http . Request
func MakeFromHTTPRequest(r *http.Request, publicBaseURL string) (*AuthRequest, error) {
	credentials := make(map[string]string)
	for key, value := range r.Header {
		credentials[strings.ToLower(key)] = value[0]
	}
	content, err := commons.ReadRequestBody(r)
	if err != nil {
		return nil, err
	}
	path, err := url.QueryUnescape(r.URL.RequestURI())
	if err != nil {
		return nil, err
	}
	return &AuthRequest{
		Credentials: credentials,
		Content:     content,
		Method:      r.Method,
		URL:         buildURL(publicBaseURL, path),
	}, nil
}
func MakeFromHTTPRequest ( r * http . Request , publicBaseURL string ) ( * AuthRequest , error ) { credentials := make ( map [ string ] string ) for key , value := range r . Header { credentials [ strings . ToLower ( key ) ] = value [ 0 ] } content , err := commons . ReadRequestBody ( r ) if err != nil { return nil , err } path , err := url . QueryUnescape ( r . URL . RequestURI ( ) ) if err != nil { return nil , err } return & AuthRequest { Credentials : credentials , Content : content , Method : r . Method , URL : buildURL ( publicBaseURL , path ) , } , nil }
MakeFromHTTPRequest generates a AuthRequest from a http.Request
MakeFromHTTPRequest generates a AuthRequest from a http . Request