Echo: cannot access the original http request

Created on 11 Mar 2016  路  2Comments  路  Source: labstack/echo

I have a logging middleware function which has an option to dump the http requests. With the latest changes echo.Request() returns a Request interface but not the original http request. In order to dump the http request with httputil I need the original request.

Do you have any thoughts about this?

question

Most helpful comment

No way to make it work across different engines as fasthttp does not build on top of standard net/http.

However, if you know that you use standard engine, the following might work:

import "github.com/labstack/echo/engine/standard"

ctx.Request().(*standard.Request).Request

All 2 comments

No way to make it work across different engines as fasthttp does not build on top of standard net/http.

However, if you know that you use standard engine, the following might work:

import "github.com/labstack/echo/engine/standard"

ctx.Request().(*standard.Request).Request

That is how you will get your original object's back.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mandeepbrar picture mandeepbrar  路  22Comments

vishr picture vishr  路  64Comments

im-kulikov picture im-kulikov  路  43Comments

zzwx picture zzwx  路  14Comments

rocketspacer picture rocketspacer  路  27Comments