summaryrefslogtreecommitdiff
path: root/jsonClient.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-31 08:45:58 -0600
committerJeff Carr <[email protected]>2024-01-31 08:45:58 -0600
commit424c8d5a36e272ccedb2a6717c2a3d08b2ea1768 (patch)
treec3ae81966d601dcb9a5fc49f1cbc135262e26d27 /jsonClient.go
parent9ff813b0ad6a68c2aad8f6a7365b452a19c07457 (diff)
add versions and timestamps
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'jsonClient.go')
-rw-r--r--jsonClient.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/jsonClient.go b/jsonClient.go
index 756fae7..4dc9b10 100644
--- a/jsonClient.go
+++ b/jsonClient.go
@@ -1,9 +1,9 @@
package main
import (
- "io/ioutil"
"bytes"
"encoding/json"
+ "io/ioutil"
"net/http"
)
@@ -33,7 +33,7 @@ func dumpJsonClient(r *http.Request) (string, error) {
var bodyBytes []byte
if r.Body != nil { // Read the body if it's not nil
bodyBytes, _ = ioutil.ReadAll(r.Body)
- r.Body.Close() // Close the body when done reading
+ r.Body.Close() // Close the body when done reading
r.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) // Reset the body
}
@@ -46,7 +46,7 @@ func dumpJsonClient(r *http.Request) (string, error) {
Headers: r.Header,
Cookies: cookieMap,
QueryParams: r.URL.Query(),
- Body: string(bodyBytes),
+ Body: string(bodyBytes),
}
// Marshal the struct to a JSON string
@@ -68,6 +68,7 @@ func dumpJsonClient(r *http.Request) (string, error) {
return string(formattedJSON), nil
}
+
/*
package main