agent/handlers/utils/helpers.go
func WriteJSONToResponse(w http.ResponseWriter, httpStatusCode int, responseJSON []byte, requestType string) {
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(httpStatusCode)
	_, err := w.Write(responseJSON)
	if err != nil {
		seelog.Errorf(
			"Unable to write %s json response message to ResponseWriter",
			requestType)
	}
}
func WriteJSONToResponse(w http.ResponseWriter, httpStatusCode int, responseJSON []byte, requestType string) {
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(httpStatusCode)
	_, err := w.Write(responseJSON)
	if err != nil {
		seelog.Errorf(
			"Unable to write %s json response message to ResponseWriter",
			requestType)
	}
}
func WriteJSONToResponse ( w http . ResponseWriter , httpStatusCode int , responseJSON [ ] byte , requestType string ) { w . Header ( ) . Set ( " " , " " ) w . WriteHeader ( httpStatusCode ) _ , err := w . Write ( responseJSON ) if err != nil { seelog . Errorf ( " " , requestType ) } }
// WriteJSONToResponse writes the header, JSON response to a ResponseWriter, and
// log the error if necessary.
WriteJSONToResponse writes the header JSON response to a ResponseWriter and log the error if necessary .