aboutsummaryrefslogtreecommitdiff
path: root/lib/http
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http')
-rw-r--r--lib/http/client.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/http/client.go b/lib/http/client.go
index e132cdc5..fbed90fc 100644
--- a/lib/http/client.go
+++ b/lib/http/client.go
@@ -20,11 +20,13 @@ import (
"mime/multipart"
"net"
"net/http"
+ "net/http/httputil"
"net/url"
"strings"
"time"
"github.com/shuLhan/share"
+ "github.com/shuLhan/share/lib/debug"
)
const (
@@ -222,6 +224,14 @@ func (client *Client) doRequest(
httpReq.Header.Set(HeaderContentType, contentType)
}
+ if debug.Value >= 2 {
+ dump, err := httputil.DumpRequestOut(httpReq, true)
+ if err != nil {
+ log.Printf("doRequest: " + err.Error())
+ }
+ fmt.Printf("%s", dump)
+ }
+
httpRes, err = client.Client.Do(httpReq)
if err != nil {
return nil, nil, err