We were requesting JSON content, however, so an instance of String is not terribly useful. Fortunately, implicit instances of EntityParser can be used to transform a ResponseEntity into a more immediately useful type.

Submitting content

Content submission is done by calling a request's apply(RequestEntity) method and setting the appropriate HTTP method.

For example:

defcreateRequest=???
createRequest.PUT.apply(RequestEntity("Some text content"))
// There's an implicit conversion from string to request entity, so the previous line can also be written as:
createRequest.PUT.apply("Some text content")
// Or, even if it's a bit misleading:
createRequest.PUT("Some text content")

It's of course possible to write custom type converters. The following (fairly useless) code will allow you to submit instances of Int: