18#if defined(CURL_FOUND)
19#define CE_HAS_HTTP_URL_PROTOCOL 1
22#if defined(CE_HAS_HTTP_URL_PROTOCOL)
495 class Request :
public IURLRequest {
498 HTTPRequestMethod method = HTTPRequestMethod::Get;
501 Map<CiString, String> headers;
506 bool withResponseBody =
true;
511 bool withResponseHeaders =
true;
515 explicit Request(
const IURLRequest& other) : IURLRequest(other) {}
518 explicit Request(
const Request& other,
const URL& url)
519 : IURLRequest(other, url), method(other.method), headers(other.headers), withResponseBody(other.withResponseBody),
520 withResponseHeaders(other.withResponseHeaders) {}
523 explicit Request(
const URL& url,
const CachePolicy& cachePolicy = CachePolicy::Default) : IURLRequest(url, cachePolicy) {}
533 class Response :
public IURLResponse {
534 friend class Connection;
537 const RC<Connection> mConnection;
541 HTTPStatusCode statusCode;
555 Map<CiString, String> headers;
559 explicit Response(
const RC<Connection>& connection);
566 [[nodiscard]] Optional<StringView> getHeader(StringView name)
const;
571 [[nodiscard]] Optional<StringView> getContentType()
const;
574 [[nodiscard]]
bool isJSON()
const;
607 using Request = HTTPURLProtocol::Request;
610 using Response = HTTPURLProtocol::Response;
Nth< 0, TTypeList > Head
First type of a type list.
Definition TypeListOps.hpp:45
Definition Application.hpp:19
BasicStringView< char > StringView
Narrow string view used for handling narrow encoded text in UTF-8.
Definition String.hpp:190
StringView toString(Button button) noexcept
Returns a string representation for the given button
cti::continuable< Args... > Async
Defines a non-copyable continuation type which uses the function2 backend for type erasure.
Definition Async.hpp:22
constexpr Byte operator<<(const Byte arg, const _IntType shift) noexcept
Definition DataTypes.hpp:44
@ Created
A file or directory has been created.
bool operator!=(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:416
std::uint16_t UInt16
Definition DataTypes.hpp:20
bool operator==(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:411
InputStream URLInputStream
A stream that provides read-only stream functionality.
Definition URLSession.hpp:43
@ Stream
A audio stream is a larger piece of audio that will be streammed for the device (instead of feeding a...
URI URL
A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or p...
Definition URLSession.hpp:40
BasicString< char > String
Narrow string used for handling narrow encoded text in UTF-8.
Definition String.hpp:163
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25