-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change inferred media type of scala.xml.Elem to application/xml.
This makes XML literals as HTML a Bad Idea, so they are ported to Twirl in the example. Related to http4s/http4s#153.
- Loading branch information
1 parent
16d934f
commit 49412e7
Showing
3 changed files
with
38 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
examples/src/main/twirl/com/example/http4s/formEncoded.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html><body> | ||
<p>Submit something.</p> | ||
<form name="input" method="post"> | ||
<p>First name: <input type="text" name="firstname"/></p> | ||
<p>Last name: <input type="text" name="lastname"/></p> | ||
<p><input type="submit" value="Submit"/></p> | ||
</form> | ||
</body></html> |
24 changes: 24 additions & 0 deletions
24
examples/src/main/twirl/com/example/http4s/index.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html> | ||
<body> | ||
<h1>Welcome to http4s.</h1> | ||
|
||
<p>Some examples:</p> | ||
|
||
<ul> | ||
<li><a href="ping">Ping route</a></li> | ||
<li><a href="future">A asynchronous result</a></li> | ||
<li><a href="streaming">A streaming result</a></li> | ||
<li><a href="ip">Get your IP address</a></li> | ||
<li><a href="redirect">A redirect url</a></li> | ||
<li><a href="content-change">A HTML result written as a String</a></li> | ||
|
||
<li><a href="echo">Echo some form encoded data</a></li> | ||
<li><a href="echo2">Echo some form encoded data minus a few chars</a></li> | ||
<li><a href="sum">Calculate the sum of the submitted numbers</a></li> | ||
<li><a href="short-sum">Try to calculate a sum, but the body will be to large</a></li> | ||
|
||
<li><a href="form-encoded">A submission form</a></li> | ||
<li><a href="push">Server push</a></li> | ||
</ul> | ||
</body> | ||
</html> |