hammer
hammer copied to clipboard
Support for Response Builder.
Rough Design:
func apiResponse(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"message":"hello world!"}`))
}
hammer.ResponseBuilder(http.ResponseWriter)
.WithStatus(http.StatusOK).
WithHeader("content-type","application/json").
WithBody(&map or &struct).
send()
The design is too vague but needs more investigation.
@ZachPlunkett would you like to have a look at this as well.