protected function build()
    {
        $content = '';
        if (isset($this->parameters) && is_array($this->parameters)) {
            $content = http_build_query($this->parameters);
        }
        if (isset($this->body)) {
            $content = $this->body;
        }

        $content_type = 'application/x-www-form-urlencoded; charset=utf-8';
        if (substr($content, 0, 6) == '<?xml ') {
            $content_type = 'text/xml; charset=utf-8';
        }

        $this->request = array(
            'http' => array(
                'header' => 'Content-type: ' . $content_type,
                'method' => 'POST',
                'timeout' => 5,
                'max_redirects' => 0,
                'ignore_errors' => 1,
                'content' => $content,
            )
        );

        return $this;
    }
protected function build()
    {
        $content = '';
        if (isset($this->parameters) && is_array($this->parameters)) {
            $content = http_build_query($this->parameters);
        }
        if (isset($this->body)) {
            $content = $this->body;
        }

        $content_type = 'application/x-www-form-urlencoded; charset=utf-8';
        if (substr($content, 0, 6) == '<?xml ') {
            $content_type = 'text/xml; charset=utf-8';
        }

        $this->request = array(
            'http' => array(
                'header' => 'Content-type: ' . $content_type,
                'method' => 'POST',
                'timeout' => 5,
                'max_redirects' => 0,
                'ignore_errors' => 1,
                'content' => $content,
            )
        );

        return $this;
    }
protected function build ( ) { $ content = '' ; if ( isset ( $ this -> parameters ) && is_array ( $ this -> parameters ) ) { $ content = http_build_query ( $ this -> parameters ) ; } if ( isset ( $ this -> body ) ) { $ content = $ this -> body ; } $ content_type = 'application/x-www-form-urlencoded; charset=utf-8' ; if ( substr ( $ content , 0 , 6 ) == '<?xml ' ) { $ content_type = 'text/xml; charset=utf-8' ; } $ this -> request = array ( 'http' => array ( 'header' => 'Content-type: ' . $ content_type , 'method' => 'POST' , 'timeout' => 5 , 'max_redirects' => 0 , 'ignore_errors' => 1 , 'content' => $ content , ) ) ; return $ this ; }
Ready the request for transport

@return PhpStreamAdapter
Ready the request for transport