mitmproxy/pathod/templates/docs_lang_responses.html

89 lines
2.8 KiB
HTML
Raw Normal View History

2015-06-22 11:11:40 +00:00
<pre class="example">code:[colon-separated list of features]</pre>
<table class="table table-bordered">
2015-06-22 11:11:40 +00:00
<tbody>
<tr>
2015-06-22 11:11:40 +00:00
<td>code</td>
<td>
<p>An integer specifying the HTTP response code.</p>
2015-06-22 11:11:40 +00:00
<p>
2015-06-26 09:47:39 +00:00
The special method <b>ws</b> creates a valid websocket upgrade
response (code 101), and moves pathod to websocket mode. Apart
from that, websocket responses are just like any other, and all
aspects of the response can be over-ridden.
2015-06-22 11:11:40 +00:00
</p>
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>m<a href="#valuespec">VALUE</a></td>
<td>
2015-06-26 09:47:39 +00:00
<span class="badge badge-info">HTTP/1 only</span> HTTP Reason message.
Automatically chosen according to the response code if not specified.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a></td>
<td>
2015-06-22 11:11:40 +00:00
Set a header.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>r</td>
<td>
2015-06-22 11:11:40 +00:00
Set the "raw" flag on this response. Pathod will not calculate a Content-Length header
if a body is set, or add a Date header to the response.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>l<a href="#valuespec">VALUE</a></td>
<td>
2015-06-22 11:11:40 +00:00
A shortcut for setting the Location header. Equivalent to h"Location"=VALUE
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>c<a href="#valuespec">VALUE</a></td>
<td>
2015-06-22 11:11:40 +00:00
A shortcut for setting the Content-Type header. Equivalent to h"Content-Type"=VALUE
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>b<a href="#valuespec">VALUE</a></td>
<td>
2015-06-26 09:47:39 +00:00
Set the body. The appropriate Content-Length header is added automatically unless
the "r" flag is set.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>d<a href="#offsetspec">OFFSET</a></td>
<td>
2015-06-26 09:47:39 +00:00
<span class="badge badge-info">HTTP/1 only</span> Disconnect after
OFFSET bytes.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a></td>
<td>
2015-06-26 09:47:39 +00:00
<span class="badge badge-info">HTTP/1 only</span> Inject the specified
value at the offset.
</td>
</tr>
<tr>
2015-06-22 11:11:40 +00:00
<td>p<a href="#offsetspec">OFFSET</a>,SECONDS</td>
<td>
2015-06-26 09:47:39 +00:00
<span class="badge badge-info">HTTP/1 only</span> Pause for SECONDS
seconds after OFFSET bytes. SECONDS can be an integer or "f" to pause
2015-06-22 11:11:40 +00:00
forever.
</td>
</tr>
</tbody>
</table>