Supported Versions: PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
Get string length
mb_strlen(string $string, ?string $encoding null): int
            'httpMethod' => 'POST',

            
'headers' => [

                
'Content-Type' => 'application/json',

                
'Content-Length' => mb_strlen(json_encode('Hello world!')),

            ],

            
'body' => json_encode('Hello world!'),

        ];
            'httpMethod' => 'POST',

            
'body' => 'foo=bar&bim=baz',

            
'headers' => [

                
'Content-Length' => mb_strlen('foo=bar&bim=baz'),

            ],

        ];

        
$this->assertGlobalVariables($event, [
            'headers' => [


                
'content-type' => 'application/json',

                
'content-length' => mb_strlen('{}'),

            ],

            
'body' => '{}',

        ];
            'httpMethod' => 'POST',

            
'headers' => [

                
'Content-Type' => 'multipart/form-data; boundary=testBoundary',

                
'Content-Length' => mb_strlen($body),

            ],

            
'body' => $body,

        ];
            'httpMethod' => 'POST',

            
'headers' => [

                
'Content-Type' => 'multipart/form-data; boundary=testBoundary',

                
'Content-Length' => mb_strlen($body),

            ],

            
'body' => $body,

        ];
            'httpMethod' => 'POST',

            
'headers' => [

                
'Content-Type' => 'multipart/form-data; boundary=testBoundary',

                
'Content-Length' => mb_strlen($body),

            ],

            
'body' => $body,

        ];
            'isBase64Encoded' => true,

            
'headers' => [

                
'Content-Type' => 'application/x-www-form-urlencoded',

                
'Content-Length' => mb_strlen('foo=bar'),

            ],

            
'body' => base64_encode('foo=bar'),

        ];