aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorZandra <[email protected]>2016-02-02 10:46:22 +0100
committerZandra <[email protected]>2016-02-02 10:46:22 +0100
commitbdfc7355e066db8812dec0c3aa70a0fae0e5d6ac (patch)
tree6f8890b4e828cc95a72205ccf2d25f761f54fffb /lib/inets/src/http_client
parent0f15f90ef5f482b0e860e41438151a5d9c4859e7 (diff)
parentb20321973be4d8f7be2f766ac51d2a7b9d5d120f (diff)
downloadotp-bdfc7355e066db8812dec0c3aa70a0fae0e5d6ac.tar.gz
otp-bdfc7355e066db8812dec0c3aa70a0fae0e5d6ac.tar.bz2
otp-bdfc7355e066db8812dec0c3aa70a0fae0e5d6ac.zip
Merge branch 'palas/maint' into maint
* palas/maint: inets: Add PATCH method to client and server OTP-13286
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc.erl7
-rw-r--r--lib/inets/src/http_client/httpc_request.erl3
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index e4a6f8f748..85663b5ded 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -101,7 +101,8 @@ request(Url, Profile) ->
%% {ok, {StatusLine, Headers, Body}} | {ok, {Status, Body}} |
%% {ok, RequestId} | {error,Reason} | {ok, {saved_as, FilePath}
%%
-%% Method - atom() = head | get | put | post | trace | options| delete
+%% Method - atom() = head | get | put | patch | post | trace |
+%% options | delete
%% Request - {Url, Headers} | {Url, Headers, ContentType, Body}
%% Url - string()
%% HTTPOptions - [HttpOption]
@@ -176,8 +177,8 @@ request(Method,
request(Method,
{Url, Headers, ContentType, Body},
HTTPOptions, Options, Profile)
- when ((Method =:= post) orelse (Method =:= put) orelse (Method =:= delete)) andalso
- (is_atom(Profile) orelse is_pid(Profile)) ->
+ when ((Method =:= post) orelse (Method =:= patch) orelse (Method =:= put) orelse
+ (Method =:= delete)) andalso (is_atom(Profile) orelse is_pid(Profile)) ->
?hcrt("request", [{method, Method},
{url, Url},
{headers, Headers},
diff --git a/lib/inets/src/http_client/httpc_request.erl b/lib/inets/src/http_client/httpc_request.erl
index e4451401f4..af4c3f75f2 100644
--- a/lib/inets/src/http_client/httpc_request.erl
+++ b/lib/inets/src/http_client/httpc_request.erl
@@ -187,7 +187,8 @@ is_client_closing(Headers) ->
%%% Internal functions
%%%========================================================================
post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
- when (Method =:= post) orelse (Method =:= put) ->
+ when (Method =:= post) orelse (Method =:= put)
+ orelse (Method =:= patch) ->
NewBody = case Headers#http_request_h.expect of
"100-continue" ->
"";