!htp #19034 refactor content negotiation, upgrade to new MediaType / ContentType model

This commit is contained in:
Mathias 2015-12-01 23:07:56 +01:00
parent e9240b7d86
commit 899b92faf2
46 changed files with 652 additions and 403 deletions

View file

@ -156,7 +156,7 @@ public class HttpServerExampleDocTest {
.via(failureDetection)
.map(request -> {
Source<ByteString, Object> bytes = request.entity().getDataBytes();
HttpEntity.Chunked entity = HttpEntities.create(ContentTypes.TEXT_PLAIN, bytes);
HttpEntityChunked entity = HttpEntities.create(ContentTypes.TEXT_PLAIN_UTF8, bytes);
return HttpResponse.create()
.withEntity(entity);
@ -199,7 +199,7 @@ public class HttpServerExampleDocTest {
if (uri.path().equals("/"))
return
HttpResponse.create()
.withEntity(ContentTypes.TEXT_HTML,
.withEntity(ContentTypes.TEXT_HTML_UTF8,
"<html><body>Hello world!</body></html>");
else if (uri.path().equals("/hello")) {
String name = Util.getOrElse(uri.query().get("name"), "Mister X");