diff options
author | Miguel A. Martin <miguel@schibstediberica.es> | 2014-05-19 16:04:55 +0200 |
---|---|---|
committer | Miguel M <miguel.a.martin@gmail.com> | 2014-06-16 09:53:32 +0000 |
commit | e7cdf98078bc94a2e430d9edef7e9b01250765ac (patch) | |
tree | 3e67262e5057110f1757dd22ce12307bf99aa68a /src | |
parent | 04884d344043063aaff1bef567912e1be0f254ff (diff) | |
download | volley-e7cdf98078bc94a2e430d9edef7e9b01250765ac.tar.gz |
Fixes bug in PATCH method. Sets the method before setting the body.
Just look at PUT and POST methods some lines above. The method is set
before calling to addBodyIfExists().
The method should be set before adding the body. Otherwise, some libraries will
try to establish a connection with the wrong method (GET by default).
Change-Id: I993a62cdc5cbccbf54f9bae4f6b183e2edf4304d
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/volley/toolbox/HurlStack.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/volley/toolbox/HurlStack.java b/src/com/android/volley/toolbox/HurlStack.java index 49bdf6a..31d57f0 100644 --- a/src/com/android/volley/toolbox/HurlStack.java +++ b/src/com/android/volley/toolbox/HurlStack.java @@ -223,8 +223,8 @@ public class HurlStack implements HttpStack { connection.setRequestMethod("TRACE"); break; case Method.PATCH: - addBodyIfExists(connection, request); connection.setRequestMethod("PATCH"); + addBodyIfExists(connection, request); break; default: throw new IllegalStateException("Unknown method type."); |