$request .= 'Accept-Charset: UTF-8,*' . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
- $request .= 'Content-Length: '.strlen($body) . getConfig('HTTP_EOL');
- $request .= 'Connection: close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
+ $request .= 'Content-Length: 0' . getConfig('HTTP_EOL');
+ $request .= 'Connection: close' . getConfig('HTTP_EOL');
+ $request .= getConfig('HTTP_EOL');
// Send the raw request
$response = sendRawRequest($host, $request);
$request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('FULL_VERSION') . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: application/x-www-form-urlencoded' . getConfig('HTTP_EOL');
- $request .= 'Connection: close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
+ $request .= 'Connection: close' . getConfig('HTTP_EOL');
+ $request .= getConfig('HTTP_EOL');
+
+ // Add body
$request .= $body;
// Send the raw request
// Close socket
fclose($fp);
+ // Time request if debug-mode is enabled
+ if (isDebugModeEnabled()) {
+ // Add debug message...
+ logDebugMessage(__FUNCTION__, __LINE__, 'Request took ' . (microtime(true) - $start) . ' seconds.');
+ } // END - if
+
// Skip first empty lines
$resp = $response;
foreach ($resp as $idx => $line) {