Network code documentation for my turn-based game 1.0
Loading...
Searching...
No Matches
http_interface.h
Go to the documentation of this file.
1#pragma once
2
3#include "types.h"
4
5#include <SFML/Network/Http.hpp>
6
12public:
13 constexpr explicit HttpInterface() noexcept = default;
14 constexpr HttpInterface(HttpInterface&& other) noexcept = default;
15 constexpr HttpInterface& operator=(HttpInterface&& other) noexcept = default;
16 constexpr HttpInterface(const HttpInterface& other) noexcept = default;
17 constexpr HttpInterface& operator=(const HttpInterface& other) noexcept = default;
18 virtual ~HttpInterface() noexcept = default;
19
20 virtual void RegisterHostAndPort(std::string_view host, Port port) noexcept = 0;
21 [[nodiscard]] virtual std::string Get(std::string_view uri) noexcept = 0;
22 virtual void Post(std::string_view uri, std::string_view json_body) noexcept = 0;
23};
HttpInterface is an interface to perform GET and POST requests via the HTTP protocol....
Definition http_interface.h:11
virtual std::string Get(std::string_view uri) noexcept=0
virtual void Post(std::string_view uri, std::string_view json_body) noexcept=0
virtual void RegisterHostAndPort(std::string_view host, Port port) noexcept=0
constexpr HttpInterface() noexcept=default
std::uint16_t Port
Definition types.h:19