02ea57d7f9
This supports asynchronous transfers of Http Requests to a network interface. Change-Id: I845fb2e08160d219f85b7a08d2d8872ac7359b47
53 lines
982 B
C++
53 lines
982 B
C++
/*
|
|
* Copyright 2022 Haiku Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
|
|
#ifndef _B_HTTP_SESSION_H_
|
|
#define _B_HTTP_SESSION_H_
|
|
|
|
#include <memory>
|
|
|
|
#include <Messenger.h>
|
|
|
|
class BUrl;
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace Network {
|
|
|
|
class BHttpRequest;
|
|
class BHttpResult;
|
|
|
|
|
|
class BHttpSession {
|
|
public:
|
|
// Constructors & Destructor
|
|
BHttpSession();
|
|
BHttpSession(const BHttpSession&) noexcept;
|
|
BHttpSession(BHttpSession&&) noexcept = delete;
|
|
~BHttpSession() noexcept;
|
|
|
|
// Assignment operators
|
|
BHttpSession& operator=(const BHttpSession&) noexcept;
|
|
BHttpSession& operator=(BHttpSession&&) noexcept = delete;
|
|
|
|
// Requests
|
|
BHttpResult Execute(BHttpRequest&& request,
|
|
std::unique_ptr<BDataIO> target = nullptr,
|
|
BMessenger observer = BMessenger());
|
|
|
|
private:
|
|
class Request;
|
|
class Impl;
|
|
std::shared_ptr<Impl> fImpl;
|
|
};
|
|
|
|
|
|
} // namespace Network
|
|
|
|
} // namespace BPrivate
|
|
|
|
#endif // _B_HTTP_SESSION_H_
|