Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any method to get all http headers dump or get the raw http header like http.Request #967

Open
robert-li-sphinx opened this Issue Apr 8, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@robert-li-sphinx
Copy link

commented Apr 8, 2018

Examples for the Iris project can be found at
https://github.com/kataras/iris/tree/master/_examples.

Documentation for the Iris project can be found at
https://godoc.org/github.com/kataras/iris.

Love iris? Please consider supporting the project:
👉 https://iris-go.com/donate

I have some thing to debug on server side, which is written in iris and golang.
now, i have some strange request to debug, and i need to dump to see the all headers of one http request. So, as the best web framework , does iris have some method to easily dump the headers ?

@kataras kataras added the question label Apr 8, 2018

@kataras

This comment has been minimized.

Copy link
Owner

commented Apr 8, 2018

Headers are just map[string][]string underline, so you can use the ctx.Request().Header to print those somewhere, no special knowedge needed here, just print/store them like a normal map, you can even use the fmt.Sprintf method.

@robert-li-sphinx

This comment has been minimized.

Copy link
Author

commented Apr 8, 2018

Great! Maybe we can add this info into the document: https://iris-go.com/v10/recipe? Just for someone else like me. Because before issues this issue, I didn't found this info in the document .

@kataras

This comment has been minimized.

Copy link
Owner

commented Apr 10, 2018

Nice that helped you @robert-li-sphinx , actually it's already here: https://github.com/kataras/iris/tree/master/_examples#how-to-read-from-contextrequest-httprequest (look the tip, it also exist as a comment on the examples theirselves) but we can add it anywhere you like if you think that these are not enough

@robert-li-sphinx

This comment has been minimized.

Copy link
Author

commented Apr 10, 2018

as an iris usage info, I think we should add this document into the recipe, which is though as an central knowledge base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.