Make codecs lookup optional for HTTP methods that cannot contain requ…#27
Open
vellotis wants to merge 1 commit intotiny-go:masterfrom
Open
Make codecs lookup optional for HTTP methods that cannot contain requ…#27vellotis wants to merge 1 commit intotiny-go:masterfrom
vellotis wants to merge 1 commit intotiny-go:masterfrom
Conversation
…est or response body. By RFC7231, only some of the HTTP methods shall contain request and response body. The `mw.Codec` method should not fail if the request or response doesn't require a body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…est or response body.
By RFC7231, only some of the HTTP methods shall contain a request and response body. The
mw.Codecmethod should not fail if the request or response doesn't require a body.body
body
Request body
The request body should be required
HEADER
Transfer-Encodingis defined and has other value thanidentityHEADER
Content-Lengthvalue is greater than0which means that the
Content-Typeheader should be present for them in the request headers.By RFC7231 the condition of
HEADER(Content-Length) < 0or not a number or missing should be considered invalid and the body should be ignored. OnlyDELETEmethod may haveTransfer-EncodingandContent-Lengthheaders missing in which case the request doesn't have a body.Response body
If the response body is required it means that the
Acceptheader should be present in the request headers.