Add more subtle content negotiation in web layer

So that single Strings can be POSTed without JSON conversion.
There's still some work to do to support single POJOs in JSON, and
to reach parity with the WebFlux reactive type handlers, but it's
now closer to what we had before we moved the String conversion
out of the function layer.
This commit is contained in:
Dave Syer
2017-05-05 09:22:23 +01:00
parent e2c257b3e7
commit 69c22482d1
8 changed files with 124 additions and 42 deletions

View File

@@ -46,6 +46,7 @@ public class SampleApplicationTests {
@Test
public void uppercase() {
// TODO: make this work with a JSON stream as well (like in WebFlux)
assertThat(new TestRestTemplate().postForObject(
"http://localhost:" + port + "/uppercase", "[{\"value\":\"foo\"}]",
String.class)).isEqualTo("[{\"value\":\"FOO\"}]");