GetAPIRequest returns the API Request of the given http request.
(r *http.Request)
| 41 | |
| 42 | // GetAPIRequest returns the API Request of the given http request. |
| 43 | func GetAPIRequest(r *http.Request) *Request { |
| 44 | ar, ok := r.Context().Value(RequestContextKey).(*Request) |
| 45 | if ok { |
| 46 | return ar |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | // TextResponse writes a text response. |
| 52 | func TextResponse(w http.ResponseWriter, r *http.Request, text string) { |