Skip to content

Commit

Permalink
Fixed commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yassiezar committed Aug 30, 2024
1 parent b344e51 commit d3f7de6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ class ClHttp : public smacc2::ISmaccClient

void onInitialize() override;

void makeRequest(const kHttpRequestMethod http_method, const std::string & path = "/", const std::string& body="", const std::unordered_map<std::string, std::string>& headers={});
void makeRequest(
const kHttpRequestMethod http_method, const std::string & path = "/",
const std::string & body = "",
const std::unordered_map<std::string, std::string> & headers = {});

private:
const int HTTP_VERSION = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ class http_session : public std::enable_shared_from_this<http_session>, public h
boost::asio::ip::tcp::resolver::results_type::endpoint_type) override;
void on_write(boost::beast::error_code ec, std::size_t bytes_transferred) override;
void on_read(boost::beast::error_code ec, std::size_t bytes_transferred) override;
void setBody(const std::string& body) override;
void setHeaders(
const std::unordered_map<std::string, std::string> & headers) override {}
void setBody(const std::string & body) override;
void setHeaders(const std::unordered_map<std::string, std::string> & headers) override {}

std::function<void(const TResponse &)> onResponse;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class http_session_base
const boost::beast::http::verb http_method, const int & version) = 0;

virtual std::string getPort() = 0;
virtual void setBody(const std::string& body) = 0;
virtual void setHeaders(const std::unordered_map<std::string, std::string>& headers) = 0;
virtual void setBody(const std::string & body) = 0;
virtual void setHeaders(const std::unordered_map<std::string, std::string> & headers) = 0;

protected:
virtual void on_resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ class ssl_http_session : public std::enable_shared_from_this<ssl_http_session>,
void on_write(boost::beast::error_code ec, std::size_t bytes_transferred) override;
void on_read(boost::beast::error_code ec, std::size_t bytes_transferred) override;
void on_shutdown(boost::beast::error_code ec) override;
void setBody(const std::string& body) override;
void setHeaders(
const std::unordered_map<std::string, std::string> & headers) override;
void appendToHeader(const std::string& key, const std::string& val);
void setBody(const std::string & body) override;
void setHeaders(const std::unordered_map<std::string, std::string> & headers) override;
void appendToHeader(const std::string & key, const std::string & val);

std::function<void(const TResponse &)> onResponse;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 RobosoftAI Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

/*
Expand Down

0 comments on commit d3f7de6

Please sign in to comment.