xref: /haiku/headers/private/netservices2/HttpSession.h (revision 13bfff7be3f1a790fc83beeee6b2e2d0216ca8cf)
1 /*
2  * Copyright 2022 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #ifndef _B_HTTP_SESSION_H_
7 #define _B_HTTP_SESSION_H_
8 
9 #include <memory>
10 
11 #include <Messenger.h>
12 
13 class BUrl;
14 
15 
16 namespace BPrivate {
17 
18 namespace Network {
19 
20 class BHttpRequest;
21 class BHttpResult;
22 
23 
24 class BHttpSession {
25 public:
26 	// Constructors & Destructor
27 							BHttpSession();
28 							BHttpSession(const BHttpSession&) noexcept;
29 							BHttpSession(BHttpSession&&) noexcept = delete;
30 							~BHttpSession() noexcept;
31 
32 	// Assignment operators
33 	BHttpSession&			operator=(const BHttpSession&) noexcept;
34 	BHttpSession&			operator=(BHttpSession&&) noexcept = delete;
35 
36 	// Requests
37 	BHttpResult				Execute(BHttpRequest&& request,
38 								std::unique_ptr<BDataIO> target = nullptr,
39 								BMessenger observer = BMessenger());
40 
41 private:
42 	struct Redirect;
43 	class Request;
44 	class Impl;
45 	std::shared_ptr<Impl>	fImpl;
46 };
47 
48 
49 } // namespace Network
50 
51 } // namespace BPrivate
52 
53 #endif // _B_HTTP_SESSION_H_
54