Skip to content

Commit 9adb662

Browse files
committed
Make Request use only Method enum instead of converting to String
1 parent 4abd423 commit 9adb662

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/httpserver/request/Request.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.List;
99

1010
public class Request {
11-
private final String method;
11+
private final Method method;
1212
private final String pathString;
1313
private final Header[] headers;
1414
private final String queryString;
@@ -19,15 +19,15 @@ public Request(Method method, String pathString, Header[] headers, String queryS
1919
}
2020

2121
public Request(Method method, String pathString, Header[] headers, String queryString, String body) {
22-
this.method = method.toString();
22+
this.method = method;
2323
this.pathString = pathString;
2424
this.headers = headers;
2525
this.queryString = queryString;
2626
this.body = body;
2727
}
2828

2929
public Method getMethod() {
30-
return Method.valueOf(method);
30+
return method;
3131
}
3232

3333
public String getPathString() {

0 commit comments

Comments
 (0)