Merge pull request #163 from meihouhao2017/master

补充之前修改后,遗漏的提交。
This commit is contained in:
郑树新 2019-07-26 09:12:35 +08:00 committed by GitHub
commit 0cadd5d2f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -554,7 +554,7 @@ void http_aclient::send_request(const void* body, size_t len)
{
http_method_t method = header_->get_method();
if (body && len > 0 && method != HTTP_METHOD_POST
&& method != HTTP_METHOD_PUT) {
&& method != HTTP_METHOD_PUT && method != HTTP_METHOD_PATCH) {
header_->set_content_length(len);
header_->set_method(HTTP_METHOD_POST);

View File

@ -333,7 +333,7 @@ bool http_request::request(const void* data, size_t len)
if (data && len > 0) {
header_.set_content_length(len);
if (method != HTTP_METHOD_POST && method != HTTP_METHOD_PUT) {
if (method != HTTP_METHOD_POST && method != HTTP_METHOD_PUT && method != HTTP_METHOD_PATCH) {
// 在有数据体的条件下,重新设置 HTTP 请求方法
header_.set_method(HTTP_METHOD_POST);
}