Package play.mvc
Class BodyParser.FormUrlEncoded
- Object
-
- play.mvc.BodyParser.MaxLengthBodyParser<A>
-
- play.mvc.BodyParser.BufferingBodyParser<Map<String,String[]>>
-
- play.mvc.BodyParser.FormUrlEncoded
-
- All Implemented Interfaces:
BodyParser<Map<String,String[]>>
- Enclosing interface:
- BodyParser<A>
public static class BodyParser.FormUrlEncoded extends BodyParser.BufferingBodyParser<Map<String,String[]>>
Parse the body as form url encoded if the Content-Type is application/x-www-form-urlencoded.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface play.mvc.BodyParser
BodyParser.AnyContent, BodyParser.BufferingBodyParser<A>, BodyParser.Bytes, BodyParser.CompletableBodyParser<A>, BodyParser.Default, BodyParser.DelegatingBodyParser<A,B>, BodyParser.DelegatingMultipartFormDataBodyParser<A>, BodyParser.Empty, BodyParser.FormUrlEncoded, BodyParser.Json, BodyParser.MaxLengthBodyParser<A>, BodyParser.MultipartFormData, BodyParser.Of, BodyParser.Raw, BodyParser.TemporaryFile, BodyParser.Text, BodyParser.ToFile, BodyParser.TolerantJson, BodyParser.TolerantText, BodyParser.TolerantXml, BodyParser.Xml
-
-
Constructor Summary
Constructors Constructor Description FormUrlEncoded(long maxLength, HttpErrorHandler errorHandler)
FormUrlEncoded(play.api.http.HttpConfiguration httpConfiguration, HttpErrorHandler errorHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Accumulator<ByteString,F.Either<Result,Map<String,String[]>>>
apply(Http.RequestHeader request)
Return an accumulator to parse the body of the given HTTP request.protected Map<String,String[]>
parse(Http.RequestHeader request, ByteString bytes)
Parse the body.-
Methods inherited from class play.mvc.BodyParser.BufferingBodyParser
apply1
-
-
-
-
Constructor Detail
-
FormUrlEncoded
public FormUrlEncoded(long maxLength, HttpErrorHandler errorHandler)
-
FormUrlEncoded
@Inject public FormUrlEncoded(play.api.http.HttpConfiguration httpConfiguration, HttpErrorHandler errorHandler)
-
-
Method Detail
-
apply
public Accumulator<ByteString,F.Either<Result,Map<String,String[]>>> apply(Http.RequestHeader request)
Description copied from interface:BodyParser
Return an accumulator to parse the body of the given HTTP request.The accumulator should either produce a result if an error was encountered, or the parsed body.
- Specified by:
apply
in interfaceBodyParser<Map<String,String[]>>
- Overrides:
apply
in classBodyParser.MaxLengthBodyParser<Map<String,String[]>>
- Parameters:
request
- The request to create the body parser for.- Returns:
- The accumulator to parse the body.
-
parse
protected Map<String,String[]> parse(Http.RequestHeader request, ByteString bytes) throws Exception
Description copied from class:BodyParser.BufferingBodyParser
Parse the body.- Specified by:
parse
in classBodyParser.BufferingBodyParser<Map<String,String[]>>
- Parameters:
request
- The request associated with the body.bytes
- The bytes of the body.- Returns:
- The body.
- Throws:
Exception
- If the body failed to parse. It is assumed that any exceptions thrown by this method are the fault of the client, so a 400 bad request error will be returned if this method throws an exception.
-
-