correct http method.

This commit is contained in:
amass 2024-05-03 21:39:01 +08:00
parent e81337c3aa
commit 88bc6c11a1

View File

@ -135,7 +135,7 @@ void Client::loadRootCertificates(boost::system::error_code &error) {
std::string Client::get(const std::string &host, const std::string &port, const std::string &url, std::string Client::get(const std::string &host, const std::string &port, const std::string &url,
boost::system::error_code &error) { boost::system::error_code &error) {
using namespace boost::beast; using namespace boost::beast;
m_request.method(http::verb::put); m_request.method(http::verb::get);
m_request.target(url); m_request.target(url);
m_request.set(http::field::host, host); m_request.set(http::field::host, host);
return execute(host, port, m_request, error); return execute(host, port, m_request, error);
@ -144,7 +144,7 @@ std::string Client::get(const std::string &host, const std::string &port, const
std::string Client::post(const std::string &host, const std::string &port, const std::string &url, std::string Client::post(const std::string &host, const std::string &port, const std::string &url,
const std::string &body, boost::system::error_code &error) { const std::string &body, boost::system::error_code &error) {
using namespace boost::beast; using namespace boost::beast;
m_request.method(http::verb::put); m_request.method(http::verb::post);
m_request.target(url); m_request.target(url);
m_request.set(http::field::host, host); m_request.set(http::field::host, host);
m_request.body() = body; m_request.body() = body;