How it works...

The github.com/unrolled/render package does the heavy lifting for this recipe. There are a huge number of other options you can input if you need to work with HTML templates and more. This recipe can be used to auto negotiate when working through web handlers as demonstrated here by passing in various content type headers, or by directly manipulating the structure.

A similar pattern can be applied to accept headers, but beware that these headers often include multiple values and your code will have to take that into account.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.42.164