As mentioned in Chapter 1, Understanding HTTP, Go, and Echo, the primary purpose of a web application is to take in a request, and render a response to the caller. Fortunately for us, Echo has a multitude of ways we can render responses back to callers. The Echo Context has the following helpers that can be used to render responses, so that you as a developer will not need to serialize the response data yourself:
HTML(code int, html string) error HTMLBlob(code int, b []byte) error String(code int, s string) error JSON(code int, i interface{}) error JSONPretty(code int, i interface{}, indent string) error JSONBlob(code int, b []byte) error JSONP(code int, callback string, i interface{}) error JSONPBlob(code int, callback string, b []byte) error XML(code int, i interface{}) error XMLPretty(code int, i interface{}, indent string) error XMLBlob(code int, b []byte...