2012-07-29 04:33:45 +00:00
|
|
|
<form style="margin-bottom: 0" class="form-inline" method="GET" action="/response_preview">
|
2012-07-24 22:24:09 +00:00
|
|
|
<input
|
2012-07-30 05:29:36 +00:00
|
|
|
style="width: 18em"
|
2012-07-24 22:24:09 +00:00
|
|
|
id="spec"
|
|
|
|
name="spec"
|
|
|
|
class="input-medium search-query"
|
|
|
|
value="{{spec}}"
|
2012-10-28 09:18:06 +00:00
|
|
|
placeholder="code:[features]"
|
2012-07-24 22:24:09 +00:00
|
|
|
>
|
2012-04-29 09:22:00 +00:00
|
|
|
<input type="submit" class="btn" value="preview">
|
2012-07-24 11:38:41 +00:00
|
|
|
{% if not nocraft %}
|
2012-07-30 05:29:36 +00:00
|
|
|
<a href="#" id="submitspec" class="btn">go</a>
|
2012-07-24 11:38:41 +00:00
|
|
|
{% endif %}
|
2012-04-29 09:22:00 +00:00
|
|
|
</form>
|
2012-07-24 23:36:19 +00:00
|
|
|
|
2012-07-29 04:33:45 +00:00
|
|
|
<a class="innerlink" data-toggle="collapse" data-target="#responseexamples">examples</a>
|
2012-07-25 00:36:53 +00:00
|
|
|
|
2012-07-24 23:36:19 +00:00
|
|
|
<div id="responseexamples" class="collapse">
|
2012-07-25 00:18:36 +00:00
|
|
|
<p>Check out the <a href="/docs/language">complete language docs</a>. Here
|
|
|
|
are some examples to get you started:</p>
|
|
|
|
|
2012-07-24 23:36:19 +00:00
|
|
|
<table class="table table-bordered">
|
|
|
|
<tbody >
|
|
|
|
<tr>
|
|
|
|
<td><a href="/response_preview?spec=200">200</a></td>
|
2012-08-16 10:29:14 +00:00
|
|
|
<td>A basic HTTP 200 response (this will hang).</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href="/response_preview?spec=200:da">200:da</a></td>
|
|
|
|
<td>Server-side disconnect after all content has been sent.</td>
|
2012-07-24 23:36:19 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href="/response_preview?spec=200:b@100">200:b@100</a></td>
|
2012-08-16 10:29:14 +00:00
|
|
|
<td>100 random bytes as the body. A Content-Lenght header is
|
|
|
|
added, so the disconnect is no longer needed.</td>
|
2012-07-24 23:36:19 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href='/response_preview?spec=200:b@100:h"Server"="';drop table servers;"'>200:b@100:h"Etag"="';drop table servers;"</a></td>
|
|
|
|
<td>Add a Server header</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href="/response_preview?spec=200:b@100:dr">200:b@100:dr</a></td>
|
|
|
|
<td>Drop the connection randomly</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href="/response_preview?spec=200:b@100,ascii:ir,@1">200:b@100,ascii:ir,@1</a></td>
|
|
|
|
<td>100 ASCII bytes as the body, and randomly inject a random byte</td>
|
|
|
|
</tr>
|
2012-07-25 00:18:36 +00:00
|
|
|
<tr>
|
|
|
|
<td><a href='/response_preview?spec=200:b@1k:c"text/json"'>200:b@1k:c"text/json"</a></td>
|
|
|
|
<td>1k of random bytes, with a text/json content type</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href='/response_preview?spec=200:b@1k:p50,120'>200:b@1k:p50,120</a></td>
|
|
|
|
<td>1k of random bytes, pause for 120 seconds after 50 bytes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><a href='/response_preview?spec=200:b@1k:pr,f'>200:b@1k:pr,f</a></td>
|
|
|
|
<td>1k of random bytes, but hang forever at a random location</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="/response_preview?spec=200:b@100:h@1k,ascii_letters='foo'">200:b@100:h@1k,ascii_letters='foo'</a>
|
|
|
|
</td>
|
|
|
|
<td>100 ASCII bytes as the body, randomly generated 100k header name, with the value 'foo'.</td>
|
|
|
|
</tr>
|
2012-07-24 23:36:19 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
2012-04-29 09:22:00 +00:00
|
|
|
<script>
|
|
|
|
$(function(){
|
2012-07-24 11:38:41 +00:00
|
|
|
{% if not nocraft %}
|
2012-04-29 09:22:00 +00:00
|
|
|
$("#submitspec").click(function(){
|
2012-07-24 11:38:41 +00:00
|
|
|
document.location = "{{craftanchor}}" + $("#spec").val()
|
2012-04-29 09:22:00 +00:00
|
|
|
});
|
2012-07-24 11:38:41 +00:00
|
|
|
{% endif %}
|
2012-04-29 09:22:00 +00:00
|
|
|
});
|
|
|
|
</script>
|