func (g GHTTPWithGomega) VerifyJSONRepresenting(object interface{}) http.HandlerFunc {
	data, err := json.Marshal(object)
	g.gomega.Expect(err).ShouldNot(HaveOccurred())
	return CombineHandlers(
		g.VerifyMimeType("application/json"),
		g.VerifyJSON(string(data)),
	)
}
VerifyJSONRepresenting is similar to VerifyJSON.  Instead of taking a JSON string, however, it
takes an arbitrary JSON-encodable object and verifies that the requests's body is a JSON representation
that matches the object
package ghttp
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"reflect"
	"strings"
	"github.com/golang/protobuf/proto"
	"github.com/onsi/gomega"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/types"
)
type GHTTPWithGomega struct {
	gomega Gomega
}
func NewGHTTPWithGomega(gomega Gomega) *GHTTPWithGomega {
	return &GHTTPWithGomega{
		gomega: gomega,
	}
}
func CombineHandlers(handlers ...http.HandlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		for _, handler := range handlers {
			handler(w, req)
		}
	}
}
func (g GHTTPWithGomega) VerifyRequest(method string, path interface{}, rawQuery ...string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		g.gomega.Expect(req.Method).Should(Equal(method), "Method mismatch")
		switch p := path.(type) {
		case types.GomegaMatcher:
			g.gomega.Expect(req.URL.Path).Should(p, "Path mismatch")
		default:
			g.gomega.Expect(req.URL.Path).Should(Equal(path), "Path mismatch")
		}
		if len(rawQuery) > 0 {
			values, err := url.ParseQuery(rawQuery[0])
			g.gomega.Expect(err).ShouldNot(HaveOccurred(), "Expected RawQuery is malformed")
			g.gomega.Expect(req.URL.Query()).Should(Equal(values), "RawQuery mismatch")
		}
	}
}
func (g GHTTPWithGomega) VerifyContentType(contentType string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		g.gomega.Expect(req.Header.Get("Content-Type")).Should(Equal(contentType))
	}
}
func (g GHTTPWithGomega) VerifyMimeType(mimeType string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		g.gomega.Expect(strings.Split(req.Header.Get("Content-Type"), ";")[0]).Should(Equal(mimeType))
	}
}
func (g GHTTPWithGomega) VerifyBasicAuth(username string, password string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		auth := req.Header.Get("Authorization")
		g.gomega.Expect(auth).ShouldNot(Equal(""), "Authorization header must be specified")
		decoded, err := base64.StdEncoding.DecodeString(auth[6:])
		g.gomega.Expect(err).ShouldNot(HaveOccurred())
		g.gomega.Expect(string(decoded)).Should(Equal(fmt.Sprintf("%s:%s", username, password)), "Authorization mismatch")
	}
}
func (g GHTTPWithGomega) VerifyHeader(header http.Header) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		for key, values := range header {
			key = http.CanonicalHeaderKey(key)
			g.gomega.Expect(req.Header[key]).Should(Equal(values), "Header mismatch for key: %s", key)
		}
	}
}
func (g GHTTPWithGomega) VerifyHeaderKV(key string, values ...string) http.HandlerFunc {
	return g.VerifyHeader(http.Header{key: values})
}
func (g GHTTPWithGomega) VerifyBody(expectedBody []byte) http.HandlerFunc {
	return CombineHandlers(
		func(w http.ResponseWriter, req *http.Request) {
			body, err := io.ReadAll(req.Body)
			req.Body.Close()
			g.gomega.Expect(err).ShouldNot(HaveOccurred())
			g.gomega.Expect(body).Should(Equal(expectedBody), "Body Mismatch")
		},
	)
}
func (g GHTTPWithGomega) VerifyJSON(expectedJSON string) http.HandlerFunc {
	return CombineHandlers(
		g.VerifyMimeType("application/json"),
		func(w http.ResponseWriter, req *http.Request) {
			body, err := io.ReadAll(req.Body)
			req.Body.Close()
			g.gomega.Expect(err).ShouldNot(HaveOccurred())
			g.gomega.Expect(body).Should(MatchJSON(expectedJSON), "JSON Mismatch")
		},
	)
}