diff options
author | qrort <qrort@yandex-team.com> | 2022-11-30 23:47:12 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-11-30 23:47:12 +0300 |
commit | 22f8ae0e3f5d68b92aecccdf96c1d841a0334311 (patch) | |
tree | bffa27765faf54126ad44bcafa89fadecb7a73d7 /library/cpp/http/client/fetch/fetch_result.h | |
parent | 332b99e2173f0425444abb759eebcb2fafaa9209 (diff) | |
download | ydb-22f8ae0e3f5d68b92aecccdf96c1d841a0334311.tar.gz |
validate canons without yatest_common
Diffstat (limited to 'library/cpp/http/client/fetch/fetch_result.h')
-rw-r--r-- | library/cpp/http/client/fetch/fetch_result.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/library/cpp/http/client/fetch/fetch_result.h b/library/cpp/http/client/fetch/fetch_result.h new file mode 100644 index 0000000000..24fe49e1f6 --- /dev/null +++ b/library/cpp/http/client/fetch/fetch_result.h @@ -0,0 +1,40 @@ +#pragma once + +#include <library/cpp/charset/doccodes.h> +#include <library/cpp/http/io/headers.h> +#include <library/cpp/langs/langs.h> + +#include <util/generic/maybe.h> +#include <util/generic/ptr.h> +#include <util/generic/string.h> +#include <util/generic/vector.h> + +#include <functional> + +namespace NHttpFetcher { + // Result + using TResultRef = TIntrusivePtr<struct TResult>; + struct TResult: public TAtomicRefCount<TResult> { + TResult(const TString& url, int code = 0); + TString DecodeData(bool* decoded = nullptr) const; + bool Success() const; + + public: + TString RequestUrl; + TString ResolvedUrl; + TString Location; + int Code; + bool ConnectionReused; + TString StatusStr; + TString MimeType; + THttpHeaders Headers; + TString Data; + TMaybe<ECharset> Encoding; + TMaybe<ELanguage> Language; + TVector<TResultRef> Redirects; + TString HttpVersion; + }; + + using TCallBack = std::function<void(TResultRef)>; + using TNeedDataCallback = std::function<bool(const TString&)>; +} |