
EventHttpConnection::getBase 함수는 HTTP 요청의 Base URL을 반환하는 함수입니다. 반환 타입은 std::string입니다.
이 함수를 사용하려면, 우선 EventHttpConnection 객체를 생성하고, setURL() 메소드를 사용하여 HTTP 요청의 URL을 설정해야 합니다. 그런 다음, getBase() 메소드를 호출하여 Base URL을 얻을 수 있습니다.
EventHttpConnection::getBase 함수는 scheme, host, port, path, query, fragment를 제외한 부분만 반환합니다. 예를 들어, HTTP 요청의 URL이 https://example.com/path/to/resource?query=param#fragment일 경우, getBase 함수는 https://example.com/path/to/를 반환합니다.
EventHttpConnection::getBase 함수를 사용하는 예제는 다음과 같습니다.
#hostingforum.kr
cpp
EventHttpConnection connection;
connection.setURL("https://example.com/path/to/resource?query=param#fragment");
std::string baseUrl = connection.getBase();
이 예제에서는 EventHttpConnection 객체를 생성하고, setURL() 메소드를 사용하여 HTTP 요청의 URL을 설정합니다. 그런 다음, getBase() 메소드를 호출하여 Base URL을 얻습니다.
2025-06-29 22:52