Class HttpConnection

java.lang.Object
io.github.enxign.shed.toolkit.HttpConnection

public class HttpConnection extends Object
HTTP 연결을 위한 유틸리티 클래스.
Since:
2020-01-09
Version:
1.0
 수정일       수정자      수정내용
 ----------   ---------   -------------------------------
 2020-01-09   first       create
 
Author:
enxign
  • Constructor Details

    • HttpConnection

      public HttpConnection()
  • Method Details

    • sendGet

      public static int sendGet(String targetUrl, StringBuilder response) throws Exception
      GET 요청을 보내는 메소드.
      Parameters:
      targetUrl - 요청할 URL
      response - 응답 결과를 저장할 StringBuilder
      Returns:
      HTTP 응답 코드
      Throws:
      Exception - 예외 발생 시
    • sendPost

      public static int sendPost(String targetUrl, Map<String,Object> parameters, StringBuilder response) throws Exception
      POST 요청을 보내는 메소드.
      Parameters:
      targetUrl - 요청할 URL
      parameters - 요청 파라미터
      response - 응답 결과를 저장할 StringBuilder
      Returns:
      HTTP 응답 코드
      Throws:
      Exception - 예외 발생 시
    • sendPost

      public static int sendPost(String targetUrl, String urlParameters, StringBuilder response) throws Exception
      POST 요청을 보내는 메소드.
      Parameters:
      targetUrl - 요청할 URL
      urlParameters - 요청 파라미터
      response - 응답 결과를 저장할 StringBuilder
      Returns:
      HTTP 응답 코드
      Throws:
      Exception - 예외 발생 시