X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpage%2FPage.java;h=8f2a4d772c03c4155554ce63313e259f96b826b3;hb=13bc2f6ae2379dd9f81edb4848971c8b4e91aabd;hp=a1125cc6a79f5d48662fb312de715a0f04c8b8ab;hpb=5a39f06f8f723980112394cc845c3d16b59aaf6b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/page/Page.java b/src/main/java/net/pterodactylus/sone/web/page/Page.java index a1125cc..8f2a4d7 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/Page.java +++ b/src/main/java/net/pterodactylus/sone/web/page/Page.java @@ -58,11 +58,42 @@ public interface Page { */ public class Request { + /** + * Enumeration for all possible HTTP request methods. + * + * @author David ‘Bombe’ + * Roden + */ + public enum Method { + + /** GET. */ + GET, + + /** POST. */ + POST, + + /** PUT. */ + PUT, + + /** DELETE. */ + DELETE, + + /** HEAD. */ + HEAD, + + /** OPTIONS. */ + OPTIONS, + + /** TRACE. */ + TRACE, + + } + /** The URI that was accessed. */ private final URI uri; /** The HTTP method that was used. */ - private final String method; + private final Method method; /** The HTTP request. */ private final HTTPRequest httpRequest; @@ -82,7 +113,7 @@ public interface Page { * @param toadletContext * The toadlet context of the request */ - public Request(URI uri, String method, HTTPRequest httpRequest, ToadletContext toadletContext) { + public Request(URI uri, Method method, HTTPRequest httpRequest, ToadletContext toadletContext) { this.uri = uri; this.method = method; this.httpRequest = httpRequest; @@ -103,7 +134,7 @@ public interface Page { * * @return The HTTP method */ - public String getMethod() { + public Method getMethod() { return method; }