<commit_before>{% extends "frame.html" %}
{% block body %}  

<div class="page-header">
   <h1>
        Language Spec
        <small>The mini-language at the heart of pathoc and pathod.</small>
    </h1>
</div>


<section id="specifying_responses">
<div class="page-header">
   <h1>Responses</h1>
</div>

    <p>The general form of a response is as follows:</p>
        
    <pre class="example">code[MESSAGE]:[colon-separated list of features]</pre></p>

    <table class="table table-bordered">
        <tbody >
            <tr>
                <td>
                    h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a>
                </td>
                <td>
                    Set a header. 
                </td>
            </tr>

            <tr>
                <td> 
                    b<a href="#valuespec">VALUE</a>
                </td>
                <td>
                    Set the body. When the body is set, pathod will
                    automatically set the appropriate Content-Length header.
                </td>
            </tr>

            <tr>
                <td>
                    c<a href="#valuespec">VALUE</a>
                </td>
                <td>
                    A shortcut for setting the Content-Type header. Equivalent to
                    h"Content-Type"=VALUE
                </td>
            </tr>

            <tr>
                <td>
                    i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a>
                </td>
                <td>
                    Inject the specified value at the offset. 
                </td>
            </tr>

            <tr>
                <td>
                    l<a href="#valuespec">VALUE</a>
                </td>
                <td>
                    A shortcut for setting the Location header. Equivalent to
                    h"Location"=VALUE
                </td>
            </tr>

            <tr>
                <td>
                    d<a href="#offsetspec">OFFSET</a>
                </td>
                <td>
                    Disconnect after OFFSET bytes. 
                </td>
            </tr>

            <tr>
                <td>
                    pSECONDS,<a href="#offsetspec">OFFSET</a>
                </td>
                <td>
                    Pause for SECONDS seconds after OFFSET bytes. SECONDS can
                    be an integer or "f" to pause forever. 
                </td>
            </tr>

            <tr>
                <td>
                    r
                </td>
                <td>
                    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>
        </tbody>
    </table>
</section>


<section id="specifying_requests">
    <div class="page-header">
       <h1>Requests</h1>
    </div>
</section>


<section id="specifying_requests">
    <div class="page-header">
       <h1>Executing specs from file</h1>
    </div>

        <pre class="example">+./path/to/spec</pre>

</section>

<section id="specifying_requests">
    <div class="page-header">
       <h1>Features</h1>
    </div>

        <a id="offsetspec"></a>
        <h2>OFFSET</h2>

            <p>Offsets are calculated relative to the base message, before any
            injections or other transforms are applied. They have 3 flavors:</p>

            <ul>
                <li>An integer byte offset </li> 
                <li><b>r</b> for a random location</li> 
                <li><b>a</b> for the end of the message</li> <commit_msg>Add basic docs for request spec language.<commit_after>{% extends "frame.html" %}
{% block body %}  

<div class="page-header">
   <h1>
        Language Spec
        <small>The mini-language at the heart of pathoc and pathod.</small>
    </h1>
</div>


<section id="specifying_responses">
<div class="page-header">
   <h1>Responses</h1>
</div>

    <p>The general form of a response is as follows:</p>
        
    <pre class="example">code[MESSAGE]:[colon-separated list of features]</pre></p>

    <table class="table table-bordered">
        <tbody >
            <tr>
                <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
                <td>
                    Set a header. 
                </td>
            </tr>

            <tr>
                <td> b<a href="#valuespec">VALUE</a> </td>
                <td>
                    Set the body. When the body is set, pathod will
                    automatically set the appropriate Content-Length header.
                </td>
            </tr>

            <tr>
                <td> c<a href="#valuespec">VALUE</a> </td>
                <td>
                    A shortcut for setting the Content-Type header. Equivalent to
                    h"Content-Type"=VALUE
                </td>
            </tr>

            <tr>
                <td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
                <td>
                    Inject the specified value at the offset. 
                </td>
            </tr>

            <tr>
                <td> l<a href="#valuespec">VALUE</a> </td>
                <td>
                    A shortcut for setting the Location header. Equivalent to
                    h"Location"=VALUE
                </td>
            </tr>

            <tr>
                <td> d<a href="#offsetspec">OFFSET</a> </td>
                <td>
                    Disconnect after OFFSET bytes. 
                </td>
            </tr>

            <tr>
                <td> pSECONDS,<a href="#offsetspec">OFFSET</a> </td>
                <td>
                    Pause for SECONDS seconds after OFFSET bytes. SECONDS can
                    be an integer or "f" to pause forever. 
                </td>
            </tr>

            <tr>
                <td> r </td>
                <td>
                    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>
        </tbody>
    </table>
</section>


<section id="specifying_requests">
    <div class="page-header">
       <h1>Requests</h1>
    </div>

    <p>The general form of a request is as follows:</p>
        
    <pre class="example">method:path:[colon-separated list of features]</pre></p>

    <table class="table table-bordered">
        <tbody >
            <tr>
                <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td>
                <td>
                    Set a header. 
                </td>
            </tr>

            <tr>
                <td> b<a href="#valuespec">VALUE</a> </td>
                <td>
                    Set the body. When the body is set, pathod will
                    automatically set the appropriate Content-Length header.
                </td>
            </tr>

            <tr>
                <td> c<a href="#valuespec">VALUE</a> </td>
                <td>
                    A shortcut for setting the Content-Type header. Equivalent to
                    h"Content-Type"=VALUE
                </td>
            </tr>

            <tr>
                <td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td>
                <td>
                    Inject the specified value at the offset. 
                </td>
            </tr>

            <tr>
                <td> d<a href="#offsetspec">OFFSET</a> </td>
                <td>
                    Disconnect after OFFSET bytes. 
                </td>
            </tr>

            <tr>
                <td> pSECONDS,<a href="#offsetspec">OFFSET</a> </td>
                <td>
                    Pause for SECONDS seconds after OFFSET bytes. SECONDS can
                    be an integer or "f" to pause forever. 
                </td>
            </tr>

            <tr>
                <td> r </td>
                <td>
                    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>
        </tbody>
    </table>

</section>


<section id="specifying_requests">
    <div class="page-header">
       <h1>Executing specs from file</h1>
    </div>

        <pre class="example">+./path/to/spec</pre>

</section>

<section id="specifying_requests">
    <div class="page-header">
       <h1>Features</h1>
    </div>

        <a id="offsetspec"></a>
        <h2>OFFSET</h2>

            <p>Offsets are calculated relative to the base message, before any
            injections or other transforms are applied. They have 3 flavors:</p>

            <ul>
                <li>An integer byte offset </li> 
                <li><b>r</b> for a random location</li> 
                <li><b>a</b> for the end of the message</li> 
{'fraction_non_alphanumeric': 0.1248080719456021, 'fraction_numerical': 0.0028515025224830006, 'mean_word_length': 1.1431257344300823, 'pattern_counts': {'":': 0, '<': 316, '<?xml version=': 0, '>': 316, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2628596', 'n_tokens_mistral': 2655, 'n_tokens_neox': 2450, 'n_words': 713}