diff --git a/lib/SimpleHttpClient/SimpleHttpClient.cpp b/lib/SimpleHttpClient/SimpleHttpClient.cpp index 9d735d54b0..03c6a8f1f3 100644 --- a/lib/SimpleHttpClient/SimpleHttpClient.cpp +++ b/lib/SimpleHttpClient/SimpleHttpClient.cpp @@ -259,9 +259,19 @@ namespace triagens { _writeBuffer.appendText("\r\n"); } - _writeBuffer.appendText("Content-Length: "); - _writeBuffer.appendInteger(bodyLength); - _writeBuffer.appendText("\r\n\r\n"); + if (method == HttpRequest::HTTP_REQUEST_GET || + method == HttpRequest::HTTP_REQUEST_HEAD || + method == HttpRequest::HTTP_REQUEST_DELETE) { + // don't use a content-length for these request types + _writeBuffer.appendText("\r\n"); + } + else { + // use a content-length for these request types + _writeBuffer.appendText("Content-Length: "); + _writeBuffer.appendInteger(bodyLength); + _writeBuffer.appendText("\r\n\r\n"); + } + _writeBuffer.appendText(body, bodyLength); LOGGER_TRACE << "Request: " << _writeBuffer.c_str();