BaguettePHP/mastodon-api

View on GitHub
docs/class-Psr.Http.Message.RequestInterface.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <title>Interface Psr\Http\Message\RequestInterface | ξ ^ω^)ξ Baguette PHP Mastodon API Client / SDK</title>

    <link rel="stylesheet" href="resources/style.css?c2f33731c1948fbed7c333554678bfa68d4817da">

</head>

<body>
<div id="left">
    <div id="menu">
        <a href="index.html" title="Overview"><span>Overview</span></a>


        <div id="groups">
                <h3>Namespaces</h3>
            <ul>
                <li>
                    <a href="namespace-Baguette.html">
                        Baguette<span></span>
                    </a>

                        <ul>
                <li>
                    <a href="namespace-Baguette.Mastodon.html">
                        Mastodon<span></span>
                    </a>

                        <ul>
                <li class="main">
                    <a href="namespace-Baguette.Mastodon.Config.html">
                        Config                    </a>

                        </li>
                <li class="main">
                    <a href="namespace-Baguette.Mastodon.Entity.html">
                        Entity                    </a>

                        </li>
                <li class="main">
                    <a href="namespace-Baguette.Mastodon.Grant.html">
                        Grant                    </a>

                        </li>
                <li class="main">
                    <a href="namespace-Baguette.Mastodon.Service.html">
                        Service                    </a>

                        </li>
                            </ul></li></ul></li>
                <li>
                    <a href="namespace-GuzzleHttp.html">
                        GuzzleHttp<span></span>
                    </a>

                        <ul>
                <li>
                    <a href="namespace-GuzzleHttp.Cookie.html">
                        Cookie                    </a>

                        </li>
                <li>
                    <a href="namespace-GuzzleHttp.Exception.html">
                        Exception                    </a>

                        </li>
                <li>
                    <a href="namespace-GuzzleHttp.Handler.html">
                        Handler                    </a>

                        </li>
                <li>
                    <a href="namespace-GuzzleHttp.Promise.html">
                        Promise                    </a>

                        </li>
                            </ul></li>
                <li class="active">
                    <a href="namespace-Psr.html">
                        Psr<span></span>
                    </a>

                        <ul>
                <li class="active">
                    <a href="namespace-Psr.Http.html">
                        Http<span></span>
                    </a>

                        <ul>
                <li class="active">
                    <a href="namespace-Psr.Http.Message.html">
                        Message                    </a>

                        </li>
                            </ul></li></ul></li>
                <li>
                    <a href="namespace-Teto.html">
                        Teto<span></span>
                    </a>

                        <ul>
                <li>
                    <a href="namespace-Teto.Object.html">
                        Object                    </a>

                        </li>
                            </ul></li>
            </ul>
        </div>

        <hr>


        <div id="elements">

            <h3>Interfaces</h3>
            <ul>
                <li><a href="class-Psr.Http.Message.MessageInterface.html">MessageInterface</a></li>
                <li class="active"><a href="class-Psr.Http.Message.RequestInterface.html">RequestInterface</a></li>
                <li><a href="class-Psr.Http.Message.ResponseInterface.html">ResponseInterface</a></li>
                <li><a href="class-Psr.Http.Message.ServerRequestInterface.html">ServerRequestInterface</a></li>
                <li><a href="class-Psr.Http.Message.StreamInterface.html">StreamInterface</a></li>
                <li><a href="class-Psr.Http.Message.UploadedFileInterface.html">UploadedFileInterface</a></li>
                <li><a href="class-Psr.Http.Message.UriInterface.html">UriInterface</a></li>
            </ul>




        </div>
    </div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
    <form id="search">
        <input type="hidden" name="cx" value="">
        <input type="hidden" name="ie" value="UTF-8">
        <input type="text" name="q" class="text" placeholder="Search">
    </form>

    <div id="navigation">
        <ul>
            <li>
                <a href="index.html" title="Overview"><span>Overview</span></a>
            </li>
            <li>
                <a href="namespace-Psr.Http.Message.html" title="Summary of Psr\Http\Message"><span>Namespace</span></a>
            </li>
            <li class="active">
<span>Class</span>            </li>
        </ul>
        <ul>
        </ul>
        <ul>
        </ul>
    </div>

<div id="content" class="class">
    <h1>Interface RequestInterface</h1>


    <div class="description">
    <p>Representation of an outgoing, client-side request.</p>

<p>Per the HTTP specification, this interface includes properties for
each of the following:</p>

<ul>
<li>Protocol version</li>
<li>HTTP method</li>
<li>URI</li>
<li>Headers</li>
<li>Message body</li>
</ul>

<p>During construction, implementations MUST attempt to set the Host header from
a provided URI if no Host header is provided.</p>

<p>Requests are considered immutable; all methods that might change state MUST
be implemented such that they retain the internal state of the current
message and return an instance that contains the changed state.</p>
    </div>

    <dl class="tree">
        <dd style="padding-left:0px">
<b><span>Psr\Http\Message\RequestInterface</span></b>            
             implements 
                <a href="class-Psr.Http.Message.MessageInterface.html"><span>Psr\Http\Message\MessageInterface</span></a>
            
            
        </dd>
    </dl>




    <div>
        <h4>Direct known implementers</h4>
            <a href="class-Psr.Http.Message.ServerRequestInterface.html">Psr\Http\Message\ServerRequestInterface</a>
    </div>




    <div class="info">
        
        
        <b>Namespace:</b> <a href="namespace-Psr.html">Psr</a>\<a href="namespace-Psr.Http.html">Http</a>\<a href="namespace-Psr.Http.Message.html">Message</a><br>
        

            <b>Located at</b> <a href="source-class-Psr.Http.Message.RequestInterface.html#5-129" title="Go to source code">RequestInterface.php</a>
        <br>
    </div>



    <table class="summary methods" id="methods">
    <caption>Methods summary</caption>
    <tr data-order="getRequestTarget" id="_getRequestTarget">

        <td class="attributes"><code>
             public 

            string
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_getRequestTarget">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#26-42" title="Go to source code">getRequestTarget</a>( )</code>

        <div class="description short">
            <p>Retrieves the message's request target.</p>
        </div>

        <div class="description detailed hidden">
            <p>Retrieves the message's request target.</p>

<p>Retrieves the message's request-target either as it will appear (for
clients), as it appeared at request (for servers), or as it was
specified for the instance (see withRequestTarget()).</p>

<p>In most cases, this will be the origin-form of the composed URI,
unless a value was provided to the concrete implementation (see
withRequestTarget() below).</p>

<p>If no URI is available, and no request-target has been specifically
provided, this method MUST return the string "/".</p>



                <h4>Returns</h4>
                <div class="list">
                    string
                </div>




        </div>
        </div></td>
    </tr>
    <tr data-order="withRequestTarget" id="_withRequestTarget">

        <td class="attributes"><code>
             public 

            static
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_withRequestTarget">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#44-61" title="Go to source code">withRequestTarget</a>( <span>mixed <var>$requestTarget</var></span> )</code>

        <div class="description short">
            <p>Return an instance with the specific request-target.</p>
        </div>

        <div class="description detailed hidden">
            <p>Return an instance with the specific request-target.</p>

<p>If the request needs a non-origin-form request-target — e.g., for
specifying an absolute-form, authority-form, or asterisk-form —
this method may be used to create an instance with the specified
request-target, verbatim.</p>

<p>This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
changed request target.</p>


                <h4>Parameters</h4>
                <div class="list"><dl>
                    <dt><var>$requestTarget</var></dt>
                    <dd></dd>
                </dl></div>

                <h4>Returns</h4>
                <div class="list">
                    static
                </div>


                <h4>Link</h4>
                <div class="list">
                        <a href="http://tools.ietf.org/html/rfc7230#section-5.3">(for the various
    request-target forms allowed in request messages)</a><br>
                </div>


        </div>
        </div></td>
    </tr>
    <tr data-order="getMethod" id="_getMethod">

        <td class="attributes"><code>
             public 

            string
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_getMethod">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#63-68" title="Go to source code">getMethod</a>( )</code>

        <div class="description short">
            <p>Retrieves the HTTP method of the request.</p>
        </div>

        <div class="description detailed hidden">
            <p>Retrieves the HTTP method of the request.</p>



                <h4>Returns</h4>
                <div class="list">
                    string<br>Returns the request method.
                </div>




        </div>
        </div></td>
    </tr>
    <tr data-order="withMethod" id="_withMethod">

        <td class="attributes"><code>
             public 

            static
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_withMethod">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#70-85" title="Go to source code">withMethod</a>( <span>string <var>$method</var></span> )</code>

        <div class="description short">
            <p>Return an instance with the provided HTTP method.</p>
        </div>

        <div class="description detailed hidden">
            <p>Return an instance with the provided HTTP method.</p>

<p>While HTTP method names are typically all uppercase characters, HTTP
method names are case-sensitive and thus implementations SHOULD NOT
modify the given string.</p>

<p>This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
changed request method.</p>


                <h4>Parameters</h4>
                <div class="list"><dl>
                    <dt><var>$method</var></dt>
                    <dd>Case-sensitive method.</dd>
                </dl></div>

                <h4>Returns</h4>
                <div class="list">
                    static
                </div>

                <h4>Throws</h4>
                <div class="list">
                    InvalidArgumentException<br>for invalid HTTP methods.
                </div>



        </div>
        </div></td>
    </tr>
    <tr data-order="getUri" id="_getUri">

        <td class="attributes"><code>
             public 

            <code><a href="class-Psr.Http.Message.UriInterface.html">Psr\Http\Message\UriInterface</a></code>
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_getUri">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#87-96" title="Go to source code">getUri</a>( )</code>

        <div class="description short">
            <p>Retrieves the URI instance.</p>
        </div>

        <div class="description detailed hidden">
            <p>Retrieves the URI instance.</p>

<p>This method MUST return a UriInterface instance.</p>



                <h4>Returns</h4>
                <div class="list">
                    <code><a href="class-Psr.Http.Message.UriInterface.html">Psr\Http\Message\UriInterface</a></code><br><p>Returns a UriInterface instance
    representing the URI of the request.</p>
                </div>


                <h4>Link</h4>
                <div class="list">
                        <a href="http://tools.ietf.org/html/rfc3986#section-4.3">http://tools.ietf.org/html/rfc3986#section-4.3</a><br>
                </div>


        </div>
        </div></td>
    </tr>
    <tr data-order="withUri" id="_withUri">

        <td class="attributes"><code>
             public 

            static
            
            </code>
        </td>

        <td class="name"><div>
        <a class="anchor" href="#_withUri">#</a>
        <code><a href="source-class-Psr.Http.Message.RequestInterface.html#98-128" title="Go to source code">withUri</a>( <span><code><a href="class-Psr.Http.Message.UriInterface.html">Psr\Http\Message\UriInterface</a></code> <var>$uri</var></span>, <span>boolean <var>$preserveHost</var> = <span class="php-keyword1">false</span></span> )</code>

        <div class="description short">
            <p>Returns an instance with the provided URI.</p>
        </div>

        <div class="description detailed hidden">
            <p>Returns an instance with the provided URI.</p>

<p>This method MUST update the Host header of the returned request by
default if the URI contains a host component. If the URI does not
contain a host component, any pre-existing Host header MUST be carried
over to the returned request.</p>

<p>You can opt-in to preserving the original state of the Host header by
setting <code>$preserveHost</code> to <code>true</code>. When <code>$preserveHost</code> is set to
<code>true</code>, this method interacts with the Host header in the following ways:</p>

<ul>
<li>If the Host header is missing or empty, and the new URI contains a host component, this method MUST update the Host header in the returned request.</li>
<li>If the Host header is missing or empty, and the new URI does not contain a host component, this method MUST NOT update the Host header in the returned request.</li>
<li>If a Host header is present and non-empty, this method MUST NOT update the Host header in the returned request.</li>
</ul>

<p>This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return an instance that has the
new UriInterface instance.</p>


                <h4>Parameters</h4>
                <div class="list"><dl>
                    <dt><var>$uri</var></dt>
                    <dd>New request URI to use.</dd>
                    <dt><var>$preserveHost</var></dt>
                    <dd>Preserve the original state of the Host header.</dd>
                </dl></div>

                <h4>Returns</h4>
                <div class="list">
                    static
                </div>


                <h4>Link</h4>
                <div class="list">
                        <a href="http://tools.ietf.org/html/rfc3986#section-4.3">http://tools.ietf.org/html/rfc3986#section-4.3</a><br>
                </div>


        </div>
        </div></td>
    </tr>
    </table>

    <table class="summary inherited">
    <caption>Methods inherited from <a href="class-Psr.Http.Message.MessageInterface.html#methods">Psr\Http\Message\MessageInterface</a></caption>
    <tr>
        <td><code>
            <a href="class-Psr.Http.Message.MessageInterface.html#_getBody">getBody()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_getHeader">getHeader()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_getHeaderLine">getHeaderLine()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_getHeaders">getHeaders()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_getProtocolVersion">getProtocolVersion()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_hasHeader">hasHeader()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_withAddedHeader">withAddedHeader()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_withBody">withBody()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_withHeader">withHeader()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_withProtocolVersion">withProtocolVersion()</a>, 
            <a href="class-Psr.Http.Message.MessageInterface.html#_withoutHeader">withoutHeader()</a>
        </code></td>
    </tr>
    </table>

















</div>

    <div id="footer">
        ξ ^ω^)ξ Baguette PHP Mastodon API Client / SDK API documentation generated by <a href="http://apigen.org">ApiGen</a>
    </div>
</div>
</div>
<script src="resources/combined.js"></script>
<script src="elementlist.js"></script>
</body>
</html>