Skip to content

Access the underlying request body #130

Answered by vearutop
chriskolenko asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, you can implement request.Loader on your input structure to take over request decoding (and validation).

	// Loader loads data from http.Request.
	//
	// Implement this interface on a pointer to your input structure to disable automatic request mapping.
	Loader interface {
		LoadFromHTTPRequest(r *http.Request) error
	}

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@chriskolenko
Comment options

@chriskolenko
Comment options

@chriskolenko
Comment options

@chriskolenko
Comment options

@vearutop
Comment options

Answer selected by chriskolenko
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants