src/LearnositySdk/Request/Remote.php
private function normalizeRequestHeaders(array $headers)
    {
        // Explicitly set an empty Expect header, so that the server will not
        // respond with a "100 Continue" status code for large uploads.
        $emptyExpectHeader = 'Expect: ';
        $haveExpectHeader = false;

        for ($i = 0; $i < count($headers); $i++) {
            if ($this->isExpectHeader($headers[$i])) {
                // There is already an expect header - let's set it to empty
                $headers[$i] = $emptyExpectHeader;
                $haveExpectHeader = true;
                break;
            }
        }

        if (!$haveExpectHeader) {
            // There is no expect header - let's add one
            $headers[] = $emptyExpectHeader;
        }

        return $headers;
    }
private function normalizeRequestHeaders(array $headers)
    {
        // Explicitly set an empty Expect header, so that the server will not
        // respond with a "100 Continue" status code for large uploads.
        $emptyExpectHeader = 'Expect: ';
        $haveExpectHeader = false;

        for ($i = 0; $i < count($headers); $i++) {
            if ($this->isExpectHeader($headers[$i])) {
                // There is already an expect header - let's set it to empty
                $headers[$i] = $emptyExpectHeader;
                $haveExpectHeader = true;
                break;
            }
        }

        if (!$haveExpectHeader) {
            // There is no expect header - let's add one
            $headers[] = $emptyExpectHeader;
        }

        return $headers;
    }
private function normalizeRequestHeaders ( array $ headers ) { // Explicitly set an empty Expect header, so that the server will not // respond with a "100 Continue" status code for large uploads. $ emptyExpectHeader = 'Expect: ' ; $ haveExpectHeader = false ; for ( $ i = 0 ; $ i < count ( $ headers ) ; $ i ++ ) { if ( $ this -> isExpectHeader ( $ headers [ $ i ] ) ) { // There is already an expect header - let's set it to empty $ headers [ $ i ] = $ emptyExpectHeader ; $ haveExpectHeader = true ; break ; } } if ( ! $ haveExpectHeader ) { // There is no expect header - let's add one $ headers [ ] = $ emptyExpectHeader ; } return $ headers ; }
Normalize the headers to be used for a request.

@param array $headers - the array of headers. Each element is a string.

@return array
Normalize the headers to be used for a request .