Btw. we will release spray 0.7.0 incl. a vastly updated documentation today.
This should hopefully clear up things even more...
Cheers,
Mathias
---
mat...@spray.cc
http://www.spray.cc
I took up on your implementation, added a corresponding Marshaller and committed it together with some more tests:
https://github.com/spray/spray/commit/7a17c8d735ee0398f9174b650526d1a51ef5c3ec
A couple of comments:
- When writing your own (un)marshaller it's usually best to rely on the existing ones for improved DRYness. In this case for example the StringUnmarshaller and StringMarshaller can do the to and from String conversion for us, no need to work on the buffer level ourselves.
- We can use the 'collection.breakOut' helper to save one list copy operation and have the 'map' operationbuild the required Map directly.
- The UnmarshallerBase comes with a handy 'protect' method that takes care of exception handling
- For application-level code it is no problem to have (Un)marshallers for generic things like Map[String, String]. However, at the library level its better to bind the (Un)marshallers to something more specific, since users might want to write (Un)marshallers for Map[String, String] that convert to and from some other format (e.g. a JSON or XML map representation). In order to enable that without implicits collisions I wrapped the map in a one-element case class "FormContent".
Anyway, the current spray 0.8.0-SNAPSHOT build now supports marshalling and unmarshalling "application/x-www-form-encoded" content.
Thanks again and cheers,
Mathias
---
mat...@spray.cc
http://www.spray.cc