Package io.github.enxign.shed.toolkit
Class HttpConnection
java.lang.Object
io.github.enxign.shed.toolkit.HttpConnection
HTTP 연결을 위한 유틸리티 클래스.
- Since:
- 2020-01-09
- Version:
- 1.0
수정일 수정자 수정내용 ---------- --------- ------------------------------- 2020-01-09 first create
- Author:
- enxign
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
sendGet
(String targetUrl, StringBuilder response) GET 요청을 보내는 메소드.static int
sendPost
(String targetUrl, String urlParameters, StringBuilder response) POST 요청을 보내는 메소드.static int
POST 요청을 보내는 메소드.
-
Constructor Details
-
HttpConnection
public HttpConnection()
-
-
Method Details
-
sendGet
GET 요청을 보내는 메소드.- Parameters:
targetUrl
- 요청할 URLresponse
- 응답 결과를 저장할 StringBuilder- Returns:
- HTTP 응답 코드
- Throws:
Exception
- 예외 발생 시
-
sendPost
public static int sendPost(String targetUrl, Map<String, Object> parameters, StringBuilder response) throws ExceptionPOST 요청을 보내는 메소드.- Parameters:
targetUrl
- 요청할 URLparameters
- 요청 파라미터response
- 응답 결과를 저장할 StringBuilder- Returns:
- HTTP 응답 코드
- Throws:
Exception
- 예외 발생 시
-
sendPost
public static int sendPost(String targetUrl, String urlParameters, StringBuilder response) throws Exception POST 요청을 보내는 메소드.- Parameters:
targetUrl
- 요청할 URLurlParameters
- 요청 파라미터response
- 응답 결과를 저장할 StringBuilder- Returns:
- HTTP 응답 코드
- Throws:
Exception
- 예외 발생 시
-