WIP: qbittorrent support

This commit is contained in:
Simon Ding
2024-10-04 01:22:27 +08:00
parent e8067f96f1
commit 6a5c105f8c
10 changed files with 2062 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package tools
import (
"fmt"
"io"
"net/http"
"net/http/httputil"
)
// PrintResponse prints the body of a response
func PrintResponse(body io.ReadCloser) {
r, _ := io.ReadAll(body)
fmt.Println("response: " + string(r))
}
// PrintRequest prints a request
func PrintRequest(req *http.Request) error {
r, err := httputil.DumpRequest(req, true)
if err != nil {
return err
}
fmt.Println("request: " + string(r))
return nil
}