// Reply with the provided HTTP response and status code.
//
// Response body must be JSON-marshallable, otherwise the response
// will be "Internal Server Error".
Reply with the provided HTTP response and status code.

Response body must be JSON-marshallable, otherwise the response
will be "Internal Server Error".
// Reply with the provided HTTP response and status code . // // Response body must be JSON - marshallable otherwise the response // will be " Internal Server Error " .
func Reply(w http.ResponseWriter, response interface{}, status int) {
	marshalledResponse, err := json.Marshal(response)
	if err != nil {
		ReplyInternalError(w, fmt.Sprintf("Failed to marshal response: %v %v", response, err))
		return
	}
	w.Header().Set("Content-Type", "application/json; charset=utf-8")
	w.WriteHeader(status)
	w.Write(marshalledResponse)
}
func Reply ( w http . ResponseWriter , response interface { } , status int ) { marshalledResponse , err := json . Marshal ( response ) if err != nil { ReplyInternalError ( w , fmt . Sprintf ( " " , response , err ) ) return } w . Header ( ) . Set ( " " , " " ) w . WriteHeader ( status ) w . Write ( marshalledResponse ) }
Reply with the provided HTTP response and status code.
Reply with the provided HTTP response and status code .
// marshal the body of the response // write JSON response