(r *http.Request)
| 13 | var defaultOffer = "text/html" |
| 14 | |
| 15 | func IsJSONRequest(r *http.Request) bool { |
| 16 | return httputil.NegotiateContentType(r, offers, defaultOffer) == "application/json" || |
| 17 | r.Header.Get("Content-Type") == "application/json" |
| 18 | } |
| 19 | |
| 20 | func IsBrowserRequest(r *http.Request) bool { |
| 21 | return httputil.NegotiateContentType(r, offers, defaultOffer) == "text/html" |