We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public HttpRequest(final InputStream in) { try { BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); String line = br.readLine(); if (line == null) { return; } requestLine = new RequestLine(line);
if(HttpRequestMethod.POST.equals(method)) { path = tokens[1]; return; } int index = tokens[1].indexOf("?"); if(index == 1) { path = tokens[1]; }else { path = tokens[1].substring(0, index); params = HttpRequestUtils.parseQueryString(tokens[1].substring(index + 1)); }
public void sendResponse(final String response) { private void responseBody(final DataOutputStream dos, final byte[] body) { private void response200Header(final DataOutputStream dos, final int length) {
String path = request.getPath(); Controller controller = RequestMapping.getController(path); if(controller == null) { response.sendResponse("안녕하세요!"); } else { controller.service(request, response); }
The text was updated successfully, but these errors were encountered:
refactor: 디렉토리 이동
bef2c5e
#6
feat(HttpRequest): 요청 로직 책임을 가진 클래스 구현
ccc1cb0
feat(HttpResponse): 응답 로직 책임을 가진 클래스 구현
b9efcd5
feat(RequestLine): 요청 값 관련 로직을 담은 가진 클래스 구현
4ec3ce5
refactor(RequestHandler): 요청과 응답에 대한 로직을 클래스로 분리하여 메서드를 호출할 수 있도록 변경
bfaba4e
refactor : 다형성을 이용해 분기삭제
6a0b8a0
mjj111
No branches or pull requests
📄 구현 포인트
✅ 간략한 코드 설명
이에 따라 요청과 응답에 대한 로직은 다른 클래스에게 위임되어 코드가 줄어듭니다.
The text was updated successfully, but these errors were encountered: