diff options
author | vvvv <vvvv@yandex-team.com> | 2024-11-01 15:41:40 +0300 |
---|---|---|
committer | vvvv <vvvv@yandex-team.com> | 2024-11-01 15:55:52 +0300 |
commit | 3325f745e67f7f442790822b5c9c5e9996708be7 (patch) | |
tree | f7318d68bbe8990092715436444b05297ce35777 /yql/essentials/utils/fetch/fetch.h | |
parent | 6dce3f1c71786f2694b73b1a5155efc58f4557dd (diff) | |
download | ydb-3325f745e67f7f442790822b5c9c5e9996708be7.tar.gz |
Moved yql/utils YQL-19206
Также была выделена жирная зависимость из yql/utils в yql/utils/network, в результате library/cpp/getopt была добавлена явно в те проекты, которые ее ранее наследовали, а не указывали явно
commit_hash:36aa4c41f807b4cbbf70a3ed7ac0a1a5079bb75d
Diffstat (limited to 'yql/essentials/utils/fetch/fetch.h')
-rw-r--r-- | yql/essentials/utils/fetch/fetch.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/yql/essentials/utils/fetch/fetch.h b/yql/essentials/utils/fetch/fetch.h new file mode 100644 index 0000000000..d9e1c3c1a5 --- /dev/null +++ b/yql/essentials/utils/fetch/fetch.h @@ -0,0 +1,24 @@ +#pragma once + +#include <library/cpp/uri/http_url.h> +#include <library/cpp/http/io/headers.h> +#include <library/cpp/http/io/stream.h> + +#include <util/datetime/base.h> +#include <util/generic/string.h> +#include <util/generic/ptr.h> + +namespace NYql { + +struct IFetchResult: public TThrRefBase { + virtual THttpInput& GetStream() = 0; + virtual unsigned GetRetCode() = 0; + virtual THttpURL GetRedirectURL(const THttpURL& baseUrl) = 0; +}; + +using TFetchResultPtr = TIntrusivePtr<IFetchResult>; + +THttpURL ParseURL(const TStringBuf addr); +TFetchResultPtr Fetch(const THttpURL& url, const THttpHeaders& additionalHeaders = {}, const TDuration& timeout = TDuration::Max(), size_t retries = 3, size_t redirects = 10); + +} // NYql |