Package io.github.enxign.shed.toolkit
Class WebClient
java.lang.Object
io.github.enxign.shed.toolkit.WebClient
외부 API 통신.
- Since:
- 2020-02-01
- Version:
- 1.0
수정일 수정자 수정내용 ---------- --------- ------------------------------- 2020-02-01 first create
- Author:
- enxign
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
sendGet
(String targetUrl, String access_token, StringBuilder response, boolean isbearer) GET 요청을 보내는 메소드.static int
sendPost
(String targetUrl, String urlParameters, StringBuilder response) POST 요청을 보내는 메소드.
-
Constructor Details
-
WebClient
public WebClient()
-
-
Method Details
-
sendGet
public static int sendGet(String targetUrl, String access_token, StringBuilder response, boolean isbearer) throws Exception GET 요청을 보내는 메소드.- Parameters:
targetUrl
- 요청할 URLaccess_token
- 인증 토큰response
- 응답 결과를 저장할 StringBuilderisbearer
- Bearer 토큰 여부- 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
- 예외 발생 시
-