Network code documentation for my turn-based game 1.0
Loading...
Searching...
No Matches
http_manager.h
Go to the documentation of this file.
1#pragma once
2
3#include "http_interface.h"
4
9class HttpManager final : public HttpInterface {
10public:
11 constexpr explicit HttpManager() noexcept = default;
12 constexpr HttpManager(HttpManager&& other) noexcept = delete;
13 constexpr HttpManager& operator=(HttpManager&& other) noexcept = delete;
14 constexpr HttpManager(const HttpManager& other) noexcept = delete;
15 constexpr HttpManager& operator=(const HttpManager& other) noexcept = delete;
16 ~HttpManager() noexcept override = default;
17
18 void RegisterHostAndPort(std::string_view host, Port port) noexcept override;
19 [[nodiscard]] std::string Get(std::string_view uri) noexcept override;
20 void Post(std::string_view uri, std::string_view json_body) noexcept override;
21
22private:
23 sf::Http http_{};
24};
HttpInterface is an interface to perform GET and POST requests via the HTTP protocol....
Definition http_interface.h:11
HttpManager is an implementation of the HttpInterface which enable to send Http GET and POST requests...
Definition http_manager.h:9
std::string Get(std::string_view uri) noexcept override
void RegisterHostAndPort(std::string_view host, Port port) noexcept override
constexpr HttpManager() noexcept=default
void Post(std::string_view uri, std::string_view json_body) noexcept override
std::uint16_t Port
Definition types.h:19