src/Client.php
/**
     * Converts a request to a batch boundary
     * @param RequestInterface $request The request
     * @return string The boundary
     */
Converts a request to a batch boundary
@param RequestInterface $request The request
@return string The boundary
Converts a request to a batch boundary @param RequestInterface $request The request @return string The boundary
private function requestToBoundary(RequestInterface $request)
    {
        $uri = $request->getUri();
        $plainRequest = '';
        $route = $uri->getPath();
        if (strlen($uri->getQuery()) > 0) {
            $route .= '?' . $uri->getQuery();
        }
        $plainRequest .= "Content-Type: application/http; msgtype=request\r\n";
        $plainRequest .= "\r\n";
        $plainRequest .= sprintf("%s %s HTTP/%s\r\n", $request->getMethod(), $route, $request->getProtocolVersion());
        $plainRequest .= sprintf("Host: %s\r\n", $uri->getHost());
        $headers = $request->getHeaders();
        foreach ($headers as $name => $values) {
            if (strtolower($name) == 'host') {
                continue;
            }
            $plainRequest .= sprintf("%s: %s\r\n", $name, implode(", ", $values));
        }
        $plainRequest .= "\r\n";
        $plainRequest .= $request->getBody()->getContents();
        return $plainRequest;
    }
private function requestToBoundary ( RequestInterface $ request ) { $ uri = $ request -> getUri ( ) ; $ plainRequest = '' ; $ route = $ uri -> getPath ( ) ; if ( strlen ( $ uri -> getQuery ( ) ) > 0 ) { $ route .= '?' . $ uri -> getQuery ( ) ; } $ plainRequest .= " Content-Type: application/http; msgtype=request \r \n " ; $ plainRequest .= " \r \n " ; $ plainRequest .= sprintf ( " %s %s HTTP/%s \r \n " , $ request -> getMethod ( ) , $ route , $ request -> getProtocolVersion ( ) ) ; $ plainRequest .= sprintf ( " Host: %s \r \n " , $ uri -> getHost ( ) ) ; $ headers = $ request -> getHeaders ( ) ; foreach ( $ headers as $ name => $ values ) { if ( strtolower ( $ name ) == 'host' ) { continue ; } $ plainRequest .= sprintf ( " %s: %s \r \n " , $ name , implode ( " ,  " , $ values ) ) ; } $ plainRequest .= " \r \n " ; $ plainRequest .= $ request -> getBody ( ) -> getContents ( ) ; return $ plainRequest ; }
Converts a request to a batch boundary
 @param RequestInterface $request The request
 @return string The boundary
Converts a request to a batch boundary @param RequestInterface $request The request @return string The boundary