|
| 1 | +/* |
| 2 | + Android Asynchronous Http Client |
| 3 | + Copyright (c) 2011 James Smith <[email protected]> |
| 4 | + http://loopj.com |
| 5 | +
|
| 6 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + you may not use this file except in compliance with the License. |
| 8 | + You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +*/ |
| 18 | + |
1 | 19 | package com.loopj.android.http;
|
2 | 20 |
|
3 | 21 | import java.net.URI;
|
4 |
| - |
5 | 22 | import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
|
6 | 23 |
|
| 24 | +/** |
| 25 | + * The current Android (API level 21) bundled version of the Apache Http Client does not implement |
| 26 | + * the HTTP PATCH method. Until the Android version is updated this can serve in it's stead. |
| 27 | + * This implementation can and should go away when the official solution arrives. |
| 28 | + */ |
7 | 29 | public final class HttpPatch extends HttpEntityEnclosingRequestBase {
|
8 | 30 |
|
9 |
| - public final static String METHOD_NAME = "PATCH"; |
10 |
| - |
11 |
| - public HttpPatch() { |
12 |
| - super(); |
13 |
| - } |
14 |
| - |
15 |
| - public HttpPatch(final URI uri) { |
16 |
| - super(); |
17 |
| - setURI(uri); |
18 |
| - } |
19 |
| - |
20 |
| - /** |
21 |
| - * @throws IllegalArgumentException if the uri is invalid. |
22 |
| - */ |
23 |
| - public HttpPatch(final String uri) { |
| 31 | + public final static String METHOD_NAME = "PATCH"; |
| 32 | + |
| 33 | + public HttpPatch() { |
24 | 34 | super();
|
25 |
| - setURI(URI.create(uri)); |
26 | 35 | }
|
27 | 36 |
|
28 |
| - @Override |
29 |
| - public String getMethod() { |
30 |
| - return METHOD_NAME; |
31 |
| - } |
| 37 | + public HttpPatch(final URI uri) { |
| 38 | + super(); |
| 39 | + setURI(uri); |
| 40 | + } |
32 | 41 |
|
| 42 | + /** |
| 43 | + * @throws IllegalArgumentException if the uri is invalid. |
| 44 | + */ |
| 45 | + public HttpPatch(final String uri) { |
| 46 | + super(); |
| 47 | + setURI(URI.create(uri)); |
| 48 | + } |
| 49 | + |
| 50 | + @Override |
| 51 | + public String getMethod() { |
| 52 | + return METHOD_NAME; |
| 53 | + } |
33 | 54 | }
|
0 commit comments