aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2016-04-05 10:08:34 +0200
committerLars Thorsen <[email protected]>2016-04-05 10:08:34 +0200
commit0526f1a5a545d2e6be0b5ef4f2588ed81447c416 (patch)
treef435d95e837174db2f87209c33b9cc43673a8e60 /lib/inets/src/http_client
parentad46aea945c946ea07d7369d9513d3e66442378f (diff)
parent0285ef94ab4d021c6bbfbe12ce6d3c1fa3c0cdda (diff)
downloadotp-0526f1a5a545d2e6be0b5ef4f2588ed81447c416.tar.gz
otp-0526f1a5a545d2e6be0b5ef4f2588ed81447c416.tar.bz2
otp-0526f1a5a545d2e6be0b5ef4f2588ed81447c416.zip
Merge branch 'FabioBatSilva/httpc-delete-body/PR-972/OTP-13383'
* FabioBatSilva/httpc-delete-body/PR-972/OTP-13383: inets: Add DELETE Body to client remove whitespaces
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc_request.erl23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/inets/src/http_client/httpc_request.erl b/lib/inets/src/http_client/httpc_request.erl
index af4c3f75f2..8fcfbc30c0 100644
--- a/lib/inets/src/http_client/httpc_request.erl
+++ b/lib/inets/src/http_client/httpc_request.erl
@@ -186,16 +186,19 @@ is_client_closing(Headers) ->
%%%========================================================================
%%% Internal functions
%%%========================================================================
-post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
- when (Method =:= post) orelse (Method =:= put)
- orelse (Method =:= patch) ->
+post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
+ when (Method =:= post)
+ orelse (Method =:= put)
+ orelse (Method =:= patch)
+ orelse (Method =:= delete) ->
+
NewBody = case Headers#http_request_h.expect of
- "100-continue" ->
- "";
- _ ->
- Body
- end,
-
+ "100-continue" ->
+ "";
+ _ ->
+ Body
+ end,
+
NewHeaders = case HeadersAsIs of
[] ->
Headers#http_request_h{
@@ -213,7 +216,7 @@ post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
_ ->
HeadersAsIs
end,
-
+
{NewHeaders, NewBody};
post_data(_, Headers, _, []) ->