=doc fixed some typos in formFields

This commit is contained in:
Konrad Malawski 2015-10-14 14:00:13 +02:00
parent 2cae81dbfc
commit 37b6df9be0

View file

@ -37,14 +37,14 @@ as required, optional, or repeated, or to filter requests where a form field has
``"amount".as[Int]`` ``"amount".as[Int]``
extract value of field "amount" as ``Int``, you need a matching implicit ``Unmarshaller`` in scope for that to work extract value of field "amount" as ``Int``, you need a matching implicit ``Unmarshaller`` in scope for that to work
(see also :ref:`http-unmarshalling-scala`) (see also :ref:`http-unmarshalling-scala`)
``"amount".as(deserializer)`` ``"amount".as(unmarshaller)``
extract value of field "amount" with an explicit ``Unmarshaller`` extract value of field "amount" with an explicit ``Unmarshaller``
``"distance".*`` ``"distance".*``
extract multiple occurrences of field "distance" as ``Iterable[String]`` extract multiple occurrences of field "distance" as ``Iterable[String]``
``"distance".as[Int].*`` ``"distance".as[Int].*``
extract multiple occurrences of field "distance" as ``Iterable[Int]``, you need a matching implicit ``Unmarshaller`` in scope for that to work extract multiple occurrences of field "distance" as ``Iterable[Int]``, you need a matching implicit ``Unmarshaller`` in scope for that to work
(see also :ref:`http-unmarshalling-scala`) (see also :ref:`http-unmarshalling-scala`)
``"distance".as(deserializer).*`` ``"distance".as(unmarshaller).*``
extract multiple occurrences of field "distance" with an explicit ``Unmarshaller`` extract multiple occurrences of field "distance" with an explicit ``Unmarshaller``
You can use :ref:`Case Class Extraction` to group several extracted values together into a case-class You can use :ref:`Case Class Extraction` to group several extracted values together into a case-class
@ -52,15 +52,16 @@ instance.
Requests missing a required field or field value will be rejected with an appropriate rejection. Requests missing a required field or field value will be rejected with an appropriate rejection.
There's also a singular version, ``formField``. Query parameters can be handled in a similar way, see ``parameters``. If There's also a singular version, :ref:`-formField-`.
you want unified handling for both query parameters and form fields, see ``anyParams``.
Query parameters can be handled in a similar way, see :ref:`-parameters-`.
Unmarshalling Unmarshalling
------------- -------------
Data POSTed from `HTML forms`_ is either of type ``application/x-www-form-urlencoded`` or of type Data POSTed from `HTML forms`_ is either of type ``application/x-www-form-urlencoded`` or of type
``multipart/form-data``. The value of an url-encoded field is a ``String`` while the value of a ``multipart/form-data``. The value of an url-encoded field is a ``String`` while the value of a
``multipart/form-data``-encoded field is a "body part" containing an entity. This means that different kind of unmarshallerss are needed depending ``multipart/form-data``-encoded field is a "body part" containing an entity. This means that different kind of unmarshallers are needed depending
on what the Content-Type of the request is: on what the Content-Type of the request is:
- A ``application/x-www-form-urlencoded`` encoded field needs an implicit ``Unmarshaller[Option[String], T]`` - A ``application/x-www-form-urlencoded`` encoded field needs an implicit ``Unmarshaller[Option[String], T]``