This commit is contained in:
C菌
2022-04-28 03:15:01 +08:00
parent c113e38d82
commit 94cd2ce218
28 changed files with 1059 additions and 14 deletions

24
tests/dl.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"fmt"
"net/http"
)
func main() {
dlpath := "http://pan.oneisall.xyz/Outline.apk"
req, _ := http.NewRequest(http.MethodHead, dlpath, nil)
rsp, _ := http.DefaultClient.Do(req)
defer rsp.Body.Close()
fmt.Println(rsp.Status)
// dump, _ := httputil.DumpResponse(rsp, false)
// fmt.Println(string(dump))
// if rsp.Header != nil {
// fmt.Printf("%v", rsp.Header)
for k, v := range rsp.Header {
fmt.Println(k, v)
}
fmt.Println(rsp.Header.Get("Content-Length"))
fmt.Println(rsp.Header.Get("Accept-Ranges"))
}