mirror of
https://github.com/eolinker/apinto
synced 2025-12-24 13:28:15 +08:00
17 lines
224 B
Go
17 lines
224 B
Go
package utils
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
)
|
|
|
|
//HeaderToString 将header转成字符串
|
|
func HeaderToString(h http.Header) string {
|
|
if h == nil {
|
|
return ""
|
|
}
|
|
s := &strings.Builder{}
|
|
h.Write(s)
|
|
return s.String()
|
|
}
|