diff --git a/changelog.md b/changelog.md index 7afd3ed..d93725d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # ehttpc changes +## 0.4.11 + +- Added support for `PATCH` method requests. + ## 0.4.10 - Fixed `ehttpc:request` and `ehttpc:request_async` to handle `Timeout = infinity` option. diff --git a/src/ehttpc.app.src b/src/ehttpc.app.src index 73adee0..e346cb8 100644 --- a/src/ehttpc.app.src +++ b/src/ehttpc.app.src @@ -1,6 +1,6 @@ {application, ehttpc, [{description, "HTTP Client for Erlang/OTP"}, - {vsn, "0.4.10"}, + {vsn, "0.4.11"}, {registered, []}, {applications, [kernel, stdlib, diff --git a/src/ehttpc.appup.src b/src/ehttpc.appup.src index ab3b2ff..4a3b2b4 100644 --- a/src/ehttpc.appup.src +++ b/src/ehttpc.appup.src @@ -1,6 +1,9 @@ %% -*- mode: erlang -*- -{"0.4.10", +{"0.4.11", [ + {"0.4.10", [ + {load_module, ehttpc, brutal_purge, soft_purge, []} + ]}, {"0.4.9", [ {load_module, ehttpc, brutal_purge, soft_purge, []} ]}, @@ -60,6 +63,9 @@ ]} ], [ + {"0.4.10", [ + {load_module, ehttpc, brutal_purge, soft_purge, []} + ]}, {"0.4.9", [ {load_module, ehttpc, brutal_purge, soft_purge, []} ]}, diff --git a/src/ehttpc.erl b/src/ehttpc.erl index 5c7ea24..43a0375 100644 --- a/src/ehttpc.erl +++ b/src/ehttpc.erl @@ -498,6 +498,10 @@ do_request(Client, get, {Path, Headers}) -> RequestRef = gun:get(Client, Path, Headers), finish_body_call_if_needed(Client, RequestRef, Headers, <<>>), RequestRef; +do_request(Client, patch, {Path, Headers, Body}) -> + RequestRef = gun:patch(Client, Path, Headers, Body), + finish_body_call_if_needed(Client, RequestRef, Headers, Body), + RequestRef; do_request(Client, post, {Path, Headers, Body}) -> RequestRef = gun:post(Client, Path, Headers, Body), finish_body_call_if_needed(Client, RequestRef, Headers, Body), diff --git a/test/ehttpc_appup_tests.erl b/test/ehttpc_appup_tests.erl index 53031ba..8c6d99c 100644 --- a/test/ehttpc_appup_tests.erl +++ b/test/ehttpc_appup_tests.erl @@ -37,7 +37,7 @@ ensure_vsn_bump_test() -> V = parse_semver(proplists:get_value(vsn, Props)), ?assert(TagV =< V). -ensuer_changelog_test() -> +ensure_changelog_test() -> {ok, [{application, ehttpc, Props}]} = file:consult("src/ehttpc.app.src"), Vsn = proplists:get_value(vsn, Props), ExpectedChangeLogLine = "## " ++ Vsn, diff --git a/test/ehttpc_tests.erl b/test/ehttpc_tests.erl index 13e5c17..03c2141 100644 --- a/test/ehttpc_tests.erl +++ b/test/ehttpc_tests.erl @@ -768,7 +768,7 @@ no_body_but_headers_indicating_body_test_() -> ), ok = ensure_not_error_response(Response2) end - || RequestType <- [put, post] + || RequestType <- [put, post, patch] ] end, RequestsWithNoBody =