|
35 | 35 | import com.fasterxml.jackson.annotation.JsonIgnore; |
36 | 36 |
|
37 | 37 |
|
38 | | -@SuppressWarnings({"rawtypes", "UnusedReturnValue", "PMD.CyclomaticComplexity"}) |
| 38 | +@SuppressWarnings({"rawtypes", "UnusedReturnValue", "PMD.CyclomaticComplexity", "PMD.GodClass"}) |
39 | 39 | public class HttpRequest extends RequestDefinition implements HttpMessage<HttpRequest, Body> |
40 | 40 | { |
41 | 41 | private int hashCode; |
@@ -63,6 +63,46 @@ public static HttpRequest request(final String path) |
63 | 63 | return new HttpRequest().withPath(path); |
64 | 64 | } |
65 | 65 |
|
| 66 | + public static HttpRequest request(final String method, final String path) |
| 67 | + { |
| 68 | + return new HttpRequest().withMethod(method).withPath(path); |
| 69 | + } |
| 70 | + |
| 71 | + public static HttpRequest get(final String path) |
| 72 | + { |
| 73 | + return request("GET", path); |
| 74 | + } |
| 75 | + |
| 76 | + public static HttpRequest head(final String path) |
| 77 | + { |
| 78 | + return request("HEAD", path); |
| 79 | + } |
| 80 | + |
| 81 | + public static HttpRequest post(final String path) |
| 82 | + { |
| 83 | + return request("POST", path); |
| 84 | + } |
| 85 | + |
| 86 | + public static HttpRequest put(final String path) |
| 87 | + { |
| 88 | + return request("PUT", path); |
| 89 | + } |
| 90 | + |
| 91 | + public static HttpRequest delete(final String path) |
| 92 | + { |
| 93 | + return request("DELETE", path); |
| 94 | + } |
| 95 | + |
| 96 | + public static HttpRequest options(final String path) |
| 97 | + { |
| 98 | + return request("OPTIONS", path); |
| 99 | + } |
| 100 | + |
| 101 | + public static HttpRequest patch(final String path) |
| 102 | + { |
| 103 | + return request("PATCH", path); |
| 104 | + } |
| 105 | + |
66 | 106 | public Boolean isKeepAlive() |
67 | 107 | { |
68 | 108 | return this.keepAlive; |
|
0 commit comments