1 #ifndef VOICEVOX_CLIENT_CPP_REQUEST_HPP_
2 #define VOICEVOX_CLIENT_CPP_REQUEST_HPP_
6 #include <cpprest/http_msg.h>
7 #include <cpprest/json.h>
30 Builder(
const std::string& path) noexcept(
false)
34 throw std::invalid_argument(
"Builder requires a value represents resource name");
42 web::http::http_request
get() noexcept
71 Builder&
header(
const utility::string_t& key,
const utility::string_t& value)
73 req_.headers().add(key, value);
web::http::http_request get() noexcept
Create and provide a request based on the settings provided so far.
Definition: request.hpp:42
Builder & body(const utility::string_t &body)
Set the body of the request. (String type)
Definition: request.hpp:84
Builder(const std::string &path) noexcept(false)
Initialize URI.
Definition: request.hpp:30
Builder & method(const web::http::method &method)
Set HTTP method to request.
Definition: request.hpp:57
web::http::http_request req_
The request object to be built.
Definition: request.hpp:112
Builder & header(const utility::string_t &key, const utility::string_t &value)
Set a header consists of a key and a value.
Definition: request.hpp:71
web::http::uri_builder uri_builder_
URI builder.
Definition: request.hpp:107
std::shared_ptr< Builder > SharedPtr
An alias of a pointer of this class.
Definition: request.hpp:21
Builder & body(const web::json::value &body)
Set the body of the request. (JSON type)
Definition: request.hpp:97
A base class for a group of builder classes.
Definition: request.hpp:16
Definition: client.hpp:16