IXR_Request example



    /** * @since 3.1.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */
    public function query( ...$args ) {
        $method  = array_shift( $args );
        $request = new IXR_Request( $method$args );
        $xml     = $request->getXml();

        $port = $this->port ? ":$this->port" : '';
        $url  = $this->scheme . '://' . $this->server . $port . $this->path;
        $args = array(
            'headers'    => array( 'Content-Type' => 'text/xml' ),
            'user-agent' => $this->useragent,
            'body'       => $xml,
        );

        // Merge Custom headers ala #8145.
/** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */
    function query( ...$args )
    {
        $method = array_shift($args);
        $request = new IXR_Request($method$args);
        $length = $request->getLength();
        $xml = $request->getXml();
        $r = "\r\n";
        $request  = "POST {$this->path} HTTP/1.0$r";

        // Merged from WP #8145 - allow custom headers         $this->headers['Host']          = $this->server;
        $this->headers['Content-Type']  = 'text/xml';
        $this->headers['User-Agent']    = $this->useragent;
        $this->headers['Content-Length']$length;

        
Home | Imprint | This part of the site doesn't use cookies.