func ReadRequest(r *bufio.Reader) (req *Request, err error) {
	var (
		b  []byte
		ok bool
	)
	req = &Request{reader: r}
	if b, err = req.readLine(); err != nil {
		return
	}
	if req.Method, req.RequestURI, req.Proto, ok = parseRequestLine(string(b)); !ok {
		return nil, fmt.Errorf("malformed HTTP request %s", b)
	}
	if req.Header, err = req.readMIMEHeader(); err != nil {
		return
	}
	req.Host = req.Header.Get("Host")
	return req, nil
}
// ReadRequest reads and parses an incoming request from b.
ReadRequest reads and parses an incoming request from b.
// ReadRequest reads and parses an incoming request from b .
func ReadRequest(r *bufio.Reader) (req *Request, err error) {
	var (
		b  []byte
		ok bool
	)
	req = &Request{reader: r}
	if b, err = req.readLine(); err != nil {
		return
	}
	if req.Method, req.RequestURI, req.Proto, ok = parseRequestLine(string(b)); !ok {
		return nil, fmt.Errorf("malformed HTTP request %s", b)
	}
	if req.Header, err = req.readMIMEHeader(); err != nil {
		return
	}
	req.Host = req.Header.Get("Host")
	return req, nil
}
func ReadRequest ( r * bufio . Reader ) ( req * Request , err error ) { var ( b [ ] byte ok bool ) req = & Request { reader : r } if b , err = req . readLine ( ) ; err != nil { return } if req . Method , req . RequestURI , req . Proto , ok = parseRequestLine ( string ( b ) ) ; ! ok { return nil , fmt . Errorf ( " " , b ) } if req . Header , err = req . readMIMEHeader ( ) ; err != nil { return } req . Host = req . Header . Get ( " " ) return req , nil }
ReadRequest reads and parses an incoming request from b.
ReadRequest reads and parses an incoming request from b .