Documentation ¶
Index ¶
- Variables
- func DownloadHTTPFile(url string, saveTo string, timeoutMSec int) (int64, error)
- func GetHTTPFile(url string, timeoutMSec int) ([]byte, error)
- func ParseHTTPRequestLine(line string) (method string, uri string, version string, err error)
- func ParseHTTPStatusLine(line string) (version string, statusCode string, reason string, err error)
- func ReadHTTPHeader(r LineReader) (firstLine string, headers map[string]string, err error)
- type LineReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHTTPHeader = errors.New("nazahttp: fxxk")
Functions ¶
func DownloadHTTPFile ¶ added in v0.13.0
获取http文件保存至本地
func GetHTTPFile ¶ added in v0.13.0
获取http文件保存至字节切片
func ParseHTTPRequestLine ¶ added in v0.13.0
Request-Line = Method SP URI SP Version CRLF
func ParseHTTPStatusLine ¶ added in v0.13.0
Status-Line = Version SP Status-Code SP Reason CRLF
func ReadHTTPHeader ¶ added in v0.13.0
func ReadHTTPHeader(r LineReader) (firstLine string, headers map[string]string, err error)
@return firstLine: request的request line或response的status line @return headers: request header fileds的键值对
Types ¶
type LineReader ¶ added in v0.13.0
Click to show internal directories.
Click to hide internal directories.