summaryrefslogtreecommitdiff
path: root/jsonClient.go
diff options
context:
space:
mode:
Diffstat (limited to 'jsonClient.go')
-rw-r--r--jsonClient.go40
1 files changed, 1 insertions, 39 deletions
diff --git a/jsonClient.go b/jsonClient.go
index 4dc9b10..aa2e450 100644
--- a/jsonClient.go
+++ b/jsonClient.go
@@ -17,8 +17,8 @@ type RequestInfo struct {
Headers map[string][]string `json:"headers"`
Cookies map[string]string `json:"cookies"`
QueryParams map[string][]string `json:"queryParams"`
+ Body string `json:"body"`
// Add other fields as needed
- Body string `json:"body"`
}
// dumpClient returns a string with JSON formatted http.Request information
@@ -68,41 +68,3 @@ func dumpJsonClient(r *http.Request) (string, error) {
return string(formattedJSON), nil
}
-
-/*
-package main
-
-import (
- "bytes"
- "encoding/json"
- "io"
- "io/ioutil"
- "net/http"
-)
-
-type RequestInfo struct {
- // ... (other fields)
- Body string `json:"body"`
- // ... (other fields)
-}
-
-func dumpClient(r *http.Request) (string, error) {
- // ... (rest of your code to collect other request info)
-
- info := RequestInfo{
- // ... (other fields)
- Body: string(bodyBytes),
- // ... (other fields)
- }
-
- // Marshal the struct to a JSON string
- jsonString, err := json.Marshal(info)
- if err != nil {
- return "", err
- }
-
- return string(jsonString), nil
-}
-
-// ... (rest of your code)
-*/