private function setContentLength()
    {
        if (!is_string($this->body)) {
            return;
        }

        $headers = array_map('strtolower', array_keys($this->headers));

        if (!in_array('content-length', $headers, true)) {
            $this->headers['Content-Length'] = strlen($this->body);
        }
    }
private function setContentLength()
    {
        if (!is_string($this->body)) {
            return;
        }

        $headers = array_map('strtolower', array_keys($this->headers));

        if (!in_array('content-length', $headers, true)) {
            $this->headers['Content-Length'] = strlen($this->body);
        }
    }
private function setContentLength ( ) { if ( ! is_string ( $ this -> body ) ) { return ; } $ headers = array_map ( 'strtolower' , array_keys ( $ this -> headers ) ) ; if ( ! in_array ( 'content-length' , $ headers , true ) ) { $ this -> headers [ 'Content-Length' ] = strlen ( $ this -> body ) ; } }
Adds if needed a `Content-Length` header field to the request.
Adds if needed a Content - Length header field to the request .