mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-08 03:27:27 +08:00
WIP: qbittorrent support
This commit is contained in:
24
pkg/go-qbittorrent/tools/tools.go
Normal file
24
pkg/go-qbittorrent/tools/tools.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user