ocket8888 commented on PR #7194:
URL: https://github.com/apache/trafficcontrol/pull/7194#issuecomment-1317676090

   > I don't think there's anything you can put in for `RequestBody` that will 
do what you want.
   
   Actually, I take that back. [It's actually fairly easy to create a type that 
marshals to an empty request body](https://go.dev/play/p/JAf0aV3bZVY).
   
   <details>
   <summary>Example</sample>
   
   ```go
   package main
   
   import (
        "encoding/json"
        "fmt"
   )
   
   type emptyJSONTester struct{}
   
   func (emptyJSONTester) MarshalJSON() ([]byte, error) {
        return []byte{}, nil
   }
   
   func main() {
        bts, _ := json.Marshal(emptyJSONTester{})
        fmt.Printf("'%s'\n", string(bts))
   }
   ```
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to