mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
add Request.String(), Response.String()
This commit is contained in:
@@ -2,6 +2,7 @@ package base
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
@@ -214,3 +215,10 @@ func (res Response) Write(bw *bufio.Writer) error {
|
||||
|
||||
return bw.Flush()
|
||||
}
|
||||
|
||||
// String implements fmt.Stringer.
|
||||
func (res Response) String() string {
|
||||
buf := bytes.NewBuffer(nil)
|
||||
res.Write(bufio.NewWriter(buf))
|
||||
return buf.String()
|
||||
}
|
||||
|
Reference in New Issue
Block a user