mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
88a7e1966d
Using url_for is useful if httpbin is served under a prefix path. For example, we can serve httpbin under http://example.org/httpbin. Previously, we have to replace all hard coded paths, which produces many diffs, and it makes hard to upgrade httpbin from source. This commit uses url_for to resolve correct path even if prefix path is used. For digest auth, we have to prepend request.script_root to request.path to pass authentication.
30 lines
1.4 KiB
HTML
Executable File
30 lines
1.4 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
</head>
|
|
<body>
|
|
<!-- Example form from HTML5 spec http://www.w3.org/TR/html5/forms.html#writing-a-form's-user-interface -->
|
|
<form method="post" action="{{ url_for('view_post') }}">
|
|
<p><label>Customer name: <input name="custname"></label></p>
|
|
<p><label>Telephone: <input type=tel name="custtel"></label></p>
|
|
<p><label>E-mail address: <input type=email name="custemail"></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size value="small"> Small </label></p>
|
|
<p><label> <input type=radio name=size value="medium"> Medium </label></p>
|
|
<p><label> <input type=radio name=size value="large"> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox name="topping" value="bacon"> Bacon </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="cheese"> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="onion"> Onion </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="mushroom"> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900" name="delivery"></label></p>
|
|
<p><label>Delivery instructions: <textarea name="comments"></textarea></label></p>
|
|
<p><button>Submit order</button></p>
|
|
</form>
|
|
</body>
|
|
</html>
|