diff --git a/Net/src/HTTPClientSession.cpp b/Net/src/HTTPClientSession.cpp index b1954b084..23aaa3c1e 100644 --- a/Net/src/HTTPClientSession.cpp +++ b/Net/src/HTTPClientSession.cpp @@ -220,6 +220,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request) } _reconnect = keepAlive; _expectResponseBody = request.getMethod() != HTTPRequest::HTTP_HEAD; + const std::string& method = request.getMethod(); if (request.getChunkedTransferEncoding()) { HTTPHeaderOutputStream hos(*this); @@ -237,7 +238,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request) #endif request.write(*_pRequestStream); } - else if ((request.getMethod() != HTTPRequest::HTTP_PUT && request.getMethod() != HTTPRequest::HTTP_POST) || request.has(HTTPRequest::UPGRADE)) + else if ((method != HTTPRequest::HTTP_PUT && method != HTTPRequest::HTTP_POST && method != HTTPRequest::HTTP_PATCH) || request.has(HTTPRequest::UPGRADE)) { Poco::CountingOutputStream cs; request.write(cs);