Giter Club home page Giter Club logo

webcc's Introduction

Webcc - C++ HTTP Library

中文版 README

Lightweight C++ HTTP client and server library based on Boost Asio for embedding purpose.

=> Build Instructions (中文版)

Git repo: https://github.com/sprinfall/webcc. Please check this one instead of the forked for the latest features.

Contents

Overview

  • Cross-platform: Windows, Linux and MacOS
  • Easy-to-use client API inspired by Python requests
  • IPv6 support
  • SSL/HTTPS support with OpenSSL
  • GZip compression support with Zlib (optional)
  • Persistent (Keep-Alive) connections
  • Data streaming
    • for uploading and downloading large files on client
    • for serving and receiving large files on server
  • Basic & Token authorization
  • Timeout control
  • Source code follows Google C++ Style
  • Automation tests and unit tests included

Client API

A Complete Example

Let's start from a complete client example:

#include <iostream>

#include "webcc/client_session.h"
#include "webcc/logger.h"

int main() {
  // Configure logger to print only to console.
  WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
  
  // Session provides convenient request APIs, stores request configurations
  // and manages persistent connenctions.
  webcc::ClientSession session;

  // Catch exceptions for error handling.
  try {
    // Send a HTTP GET request.
    auto r =
        session.Send(webcc::RequestBuilder{}.Get("http://httpbin.org/get")());

    // Print the response data.
    std::cout << r->data() << std::endl;

  } catch (const webcc::Error& error) {
    std::cerr << error << std::endl;
  }

  return 0;
}

Request Builder

As you can see, a helper class named RequestBuilder is used to chain the parameters and finally build a request object. Please pay attention to the () operator.

URL query parameters can be easily added through Query() method:

session.Send(webcc::RequestBuilder{}
                 .Get("http://httpbin.org/get")
                 .Query("key1", "value1")
                 .Query("key2", "value2")());

Adding additional headers is also easy:

session.Send(webcc::RequestBuilder{}
                 .Get("http://httpbin.org/get")
                 .Header("Accept", "application/json")());

HTTPS

Accessing HTTPS has no difference from HTTP:

session.Send(webcc::RequestBuilder{}.Get("https://httpbin.org/get")());

NOTE: The HTTPS/SSL support requires the build option WEBCC_ENABLE_SSL to be enabled.

Invoking GitHub REST API

Listing GitHub public events is not a big deal:

auto r = session.Send(
    webcc::RequestBuilder{}.Get("https://api.github.com/events")());

You can then parse r->data() to JSON object with your favorite JSON library. My choice for the examples is jsoncpp. But Webcc itself doesn't understand JSON nor require one. It's up to you to choose the most appropriate JSON library.

RequestBuilder provides a lot of functions for you to customize the request. Let's see more examples.

Authorization

In order to list the followers of an authorized GitHub user, you need either Basic Authorization:

session.Send(webcc::RequestBuilder{}.
             Get("https://api.github.com/user/followers").
             AuthBasic(<login>, <password>)
             ());

Or Token Authorization:

session.Send(webcc::RequestBuilder{}
                 .Get("https://api.github.com/user/followers")
                 .AuthToken(token)());

Keep-Alive

Though Keep-Alive (i.e., Persistent Connection) is a good feature and enabled by default, you can turn it off:

auto r = session.Send(
    webcc::RequestBuilder{}.Get("http://httpbin.org/get").KeepAlive(false)());

The API for other HTTP requests is no different from GET.

POST Request

A POST request needs a body which is normally a JSON string for REST API. Let's post a small UTF-8 encoded JSON string:

session.Send(webcc::RequestBuilder{}
                 .Post("http://httpbin.org/post")
                 .Body("{'name'='Adam', 'age'=20}")
                 .Json()
                 .Utf8()());

The body of a POST request could be any content other than JSON string.

It could be the binary data of a file. See Uploading Files.

It could be a form urlencoded string:

webcc::ClientSession session;
session.SetContentType("application/x-www-form-urlencoded", "utf8");

// Use UrlQuery to compose the urlencoded string.
// Don't use RequestBuilder::Query() which is dedicated to GET.
webcc::UrlQuery query;
query.Add("key1", "value1");
query.Add("key2", "value2");
// ...

auto r = session.Send(webcc::RequestBuilder{}
                          .Post("http://httpbin.org/post")
                          .Body(query.ToString())());

Please see examples/form_urlencoded_client.cc for more details.

Downloading Files

Webcc has the ability to stream large response data to a file. This is especially useful when downloading files.

// stream = true
auto r = session.Send(
    webcc::RequestBuilder{}.Get("http://httpbin.org/image/jpeg")(), true);

// Move the streamed file to your destination.
r->file_body()->Move("./wolf.jpeg");

Uploading Files

Streaming is also available for uploading:

auto r = session.Send(
    webcc::RequestBuilder{}.Post("http://httpbin.org/post").File(path)());

The file will not be loaded into the memory all at once, instead, it will be read and sent piece by piece.

Please note that Content-Length header will still be set to the true size of the file, this is different from the handling of chunked data (Transfer-Encoding: chunked).

Client API and Threads

A ClientSession shouldn't be used by multiple threads to send requests.

The state functions, Start(), Stop() and Cancel(), are thread safe. E.g., you can call Send() in thread A and call Stop() in thread B. Please see examples/heartbeat_client for more details.

Example:

void ThreadedClient() {
  std::vector<std::thread> threads;

  for (int i = 0; i < 3; ++i) {
    threads.emplace_back([]() {
      webcc::ClientSession session;

      try {
        auto r = session.Send(
            webcc::RequestBuilder{}.Get("http://httpbin.org/get")());

        std::cout << r->data() << std::endl;

      } catch (const webcc::Error&) {
      }
    });
  }

  for (auto& t : threads) {
    t.join();
  }
}

Server API

A Minimal Server

The following example is a minimal yet complete HTTP server.

Start it, open a browser with localhost:8080, you will see Hello, World! as response.

#include "webcc/logger.h"
#include "webcc/response_builder.h"
#include "webcc/server.h"

class HelloView : public webcc::View {
public:
  webcc::ResponsePtr Handle(webcc::RequestPtr request) override {
    if (request->method() == "GET") {
      return webcc::ResponseBuilder{}.OK().Body("Hello, World!")();
    }

    return {};
  }
};

int main() {
  try {
    webcc::Server server{ boost::asio::ip::tcp::v4(), 8080 };

    server.Route("/", std::make_shared<HelloView>());

    server.Run();

  } catch (const std::exception&) {
    return 1;
  }

  return 0;
}

URL Route

The Route() method routes different URLs to different views.

You can route different URLs to the same view:

server.Route("/", std::make_shared<HelloView>());
server.Route("/hello", std::make_shared<HelloView>());

Or even the same view object:

auto view = std::make_shared<HelloView>();
server.Route("/", view);
server.Route("/hello", view);

But normally a view only handles a specific URL (see the Book Server example).

The URL could be regular expressions. The Book Server example uses a regex URL to match against book IDs.

Finally, it's always suggested to explicitly specify the HTTP methods allowed for a route:

server.Route("/", std::make_shared<HelloView>(), { "GET" });

Running A Server

The last thing about server is Run():

void Run(std::size_t workers = 1, std::size_t loops = 1);

Workers are threads which will be waken to process the HTTP requests once they arrive. Theoretically, the more workers you have, the more concurrency you gain. In practice, you have to take the number of CPU cores into account and allocate a reasonable number for it.

The loops means the number of threads running the IO Context of Asio. Normally, one thread is good enough, but it could be more than that.

Response Builder

The server API provides a helper class ResponseBuilder for the views to chain the parameters and finally build a response object. This is exactly the same strategy as RequestBuilder.

REST Book Server

Suppose you want to create a book server and provide the following operations with RESTful API:

  • Query books based on some criterias.
  • Add a new book.
  • Get the detailed information of a book.
  • Update the information of a book.
  • Delete a book.

The first two operations are implemented by BookListView deriving from webcc::View:

class BookListView : public webcc::View {
public:
  webcc::ResponsePtr Handle(webcc::RequestPtr request) override {
    if (request->method() == "GET") {
      return Get(request);
    }
    if (request->method() == "POST") {
      return Post(request);
    }
    return {};
  }
  
private:
  // Get a list of books based on query parameters.
  webcc::ResponsePtr Get(webcc::RequestPtr request);

  // Create a new book.
  // The new book's data is attached as request data in JSON format.
  webcc::ResponsePtr Post(webcc::RequestPtr request);
};

Other operations are implemented by BookDetailView:

class BookDetailView : public webcc::View {
public:
  webcc::ResponsePtr Handle(webcc::RequestPtr request) override {
    if (request->method() == "GET") {
      return Get(request);
    }
    if (request->method() == "PUT") {
      return Put(request);
    }
    if (request->method() == "DELETE") {
      return Delete(request);
    }
    return {};
  }
  
protected:
  // Get the detailed information of a book.
  webcc::ResponsePtr Get(webcc::RequestPtr request);

  // Update a book.
  webcc::ResponsePtr Put(webcc::RequestPtr request);

  // Delete a book.
  webcc::ResponsePtr Delete(webcc::RequestPtr request);
};

The detailed implementation is out of the scope of this README, but here is an example:

webcc::ResponsePtr BookDetailView::Get(webcc::RequestPtr request) {
  if (request->args().size() != 1) {
    // NotFound means the resource specified by the URL cannot be found.
    // BadRequest could be another choice.
    return webcc::ResponseBuilder{}.NotFound()();
  }

  const std::string& book_id = request->args()[0];

  // Get the book by ID from, e.g., the database.
  // ...

  if (<NotFound>) {
    // There's no such book with the given ID. 
    return webcc::ResponseBuilder{}.NotFound()();
  }

  // Convert the book to JSON string and set as response data.
  return webcc::ResponseBuilder{}.OK().Data(<JsonStringOfTheBook>).
      Json().Utf8()();
}

Last step, route URLs to the proper views and run the server:

int main(int argc, char* argv[]) {
  // ...

  try {
    webcc::Server server{ boost::asio::ip::tcp::v4(), 8080 };

    server.Route("/books",
                 std::make_shared<BookListView>(),
                 { "GET", "POST" });

    server.Route(webcc::R("/books/(\\d+)"),
                 std::make_shared<BookDetailView>(),
                 { "GET", "PUT", "DELETE" });

    server.Run();

  } catch (const std::exception& e) {
    std::cerr << e.what() << std::endl;
    return 1;
  }

  return 0;

Please see examples/book_server for more details.

IPv6 Support

IPv6 Server

Only need to change the protocol to boost::asio::ip::tcp::v6():

webcc::Server server{ boost::asio::ip::tcp::v6(), 8080 };

IPv6 Client

Only need to specify an IPv6 address:

session.Send(webcc::RequestBuilder{}.Get("http://[::1]:8080/books")());

webcc's People

Contributors

sprinfall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webcc's Issues

为啥不提供异步接口

我看了您的部分代码(主要是关于http client部分的),发现其本身就是支持异步调用的。


void ClientBase::AsyncResolve(string_view default_port) {
std::string port = request_->port();
if (port.empty()) {
port = ToString(default_port);
}

LOG_VERB("Resolve host (%s)", request_->host().c_str());

// The protocol depends on the host, both V4 and V6 are supported.
resolver_.async_resolve(request_->host(), port,
std::bind(&ClientBase::OnResolve, this, _1, _2));
}

void ClientBase::OnResolve(boost::system::error_code ec,
tcp::resolver::results_type endpoints) {
if (ec) {
LOG_ERRO("Host resolve error (%s)", ec.message().c_str());
error_.Set(Error::kResolveError, "Host resolve error");
FinishRequest();
return;
}

LOG_VERB("Connect socket");

AsyncWaitDeadlineTimer(connect_timeout_);

socket_->AsyncConnect(request_->host(), endpoints,
std::bind(&ClientBase::OnConnect, this, _1, _2));
}

以上代码就是异步调用的。只是在ClientBase::FinishRequest函数中强行做了一个同步。

我比较好奇的是,为啥不开放异步调用接口。对整个框架其实也没有额外的负担。

Windows Compile

Hi,

I am trying to compile on the windows 10 .

compiled boost 1.74.0 and then try to :

cmake -G"MinGW Makefiles" ..

gives error.

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: system date_time) (found version "1.74.0")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
CMakeLists.txt:68 (find_package)

Boost is at C:\boost_1_74_0\

I used before cmake. : set Boost_ROOT=C:\boost_1_74_0\

compiled boost as

`b2.exe --with-system --with-date_time --with-filesystem variant=debug variant=release link=static threading=multi address-model=64 stage

best
`

关于头文件问题

你好,我尝试使用的你例子程序,但是我发现了好多关于头文件的问题。类似于这样

In file included from hello_world_server.cc:2:0:
webcc/response_builder.h:7:27: fatal error: webcc/request.h: 没有那个文件或目录
#include "webcc/request.h"

的错误。
我把你的根目录下的webcc目录复制到了example目录底下,但是我又得到类似的错误是关于webcc里面的.cc文件 ,因为它包含的头文件目录也是webcc/xxx这个目录是找不到的,这是得都需要我手动编辑再更改码?还是说我哪里操作有误,因为我看到您得Readme文件也没有特殊说明,所以我特地来问下您。如果可以看到请帮助我解答一下,谢谢您。

是否支持多线程的请求?

不知道这个库跟“Pistache”比较怎么样?Pistache在自我介绍的时候有提多线程支持,不知道webcc是否支持?

Max OS 10.14 编译报错

$ make -j4
[  2%] Built target jsoncpp
[  8%] Building CXX object webcc/CMakeFiles/webcc.dir/body.cc.o
[  8%] Building CXX object webcc/CMakeFiles/webcc.dir/client_session.cc.o
[  8%] Building CXX object webcc/CMakeFiles/webcc.dir/client_pool.cc.o
[  8%] Building CXX object webcc/CMakeFiles/webcc.dir/client.cc.o
In file included from /Users/miles/webcc/webcc/body.cc:1:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:161:53: error: 'path' is unavailable: introduced in macOS 10.15
                             const std::filesystem::path& path,
                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:232:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
/Users/miles/webcc/webcc/body.h:155:35: error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, std::size_t chunk_size);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
/Users/miles/webcc/webcc/body.h:162:35: error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, bool auto_delete = false);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
/Users/miles/webcc/webcc/body.h:176:26: error: 'path' is unavailable: introduced in macOS 10.15
  const std::filesystem::path& path() const {
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
/Users/miles/webcc/webcc/body.h:190:36: error: 'path' is unavailable: introduced in macOS 10.15
  bool Move(const std::filesystem::path& new_path);
                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:1:
/Users/miles/webcc/webcc/body.h:193:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:3:
/Users/miles/webcc/webcc/logger.h:52:37: error: 'path' is unavailable: introduced in macOS 10.15
void LogInit(const std::filesystem::path& dir, int modes);
                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:4:
/Users/miles/webcc/webcc/utility.h:31:45: error: 'path' is unavailable: introduced in macOS 10.15
std::size_t TellSize(const std::filesystem::path& path);
                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/body.cc:4:
/Users/miles/webcc/webcc/utility.h:34:38: error: 'path' is unavailable: introduced in macOS 10.15
bool ReadFile(const std::filesystem::path& path, std::string* output);
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
/Users/miles/webcc/webcc/body.cc:156:43: error: 'path' is unavailable: introduced in macOS 10.15
FileBody::FileBody(const std::filesystem::path& path, std::size_t chunk_size)
                                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
/Users/miles/webcc/webcc/body.cc:157:7: error: 'path' is unavailable: introduced in macOS 10.15
    : path_(path), chunk_size_(chunk_size), auto_delete_(false), size_(0) {
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:764:29: note: 'path' has been
      explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY path(const path& __p) : __pn_(__p.__pn_) {}
                            ^
/Users/miles/webcc/webcc/body.cc:156:11: error: '~path' is unavailable: introduced in macOS 10.15
FileBody::FileBody(const std::filesystem::path& path, std::size_t chunk_size)
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been
      explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:161:53: error: 'path' is unavailable: introduced in macOS 10.15
                             const std::filesystem::path& path,
                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly /Users/miles/webcc/webcc/body.ccmarked: 164unavailable: 43here:
error: 'path' is class _LIBCPP_TYPE_VIS path {unavailable:
 introduced                       ^
in macOS 10.15
FileBody::FileBody(const std::filesystem::path& path, bool auto_delete)
                                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:232:20: error: 'path' is unavailable:/Users/miles/webcc/webcc/body.cc :introduced165 :in7 :macOS  10.15error
: 'path' is unavailable: introduced   std::filesystem::path path_;in
 macOS                   ^
10.15
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly     : path_(path), chunk_size_(0), auto_delete_(auto_delete), size_(0) {marked
 unavailable      ^
here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:764:29: class _LIBCPP_TYPE_VIS path {
note                       ^:
'path' has been
      explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY path(const path& __p) : __pn_(__p.__pn_) {}
                            ^
/Users/miles/webcc/webcc/body.cc:164:11: error: '~path' is unavailable: introduced in macOS 10.15
FileBody::FileBody(const std::filesystem::path& path, bool auto_delete)
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been
      explicitly marked unavailable here
  ~path() = default;
  ^
/Users/miles/webcc/webcc/body.cc:170:30: error: 'empty' is unavailable: introduced in macOS 10.15
  if (auto_delete_ && !path_.empty()) {
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:1077:3: note: 'empty' has been
      explicitly marked unavailable here
  empty() const noexcept {
  ^
/Users/miles/webcc/webcc/body.cc:172:22: error: 'remove' is unavailable: introduced in macOS 10.15
    std::filesystem::remove(path_, ec);
                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:1868:39: note: 'remove' has been
      explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY bool remove(const path& __p,
                                      ^
/Users/miles/webcc/webcc/body.cc:169:11: error: '~path' is unavailable: introduced in macOS 10.15
FileBody::~FileBody() {
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been
      explicitly marked unavailable here
  ~path() = default;
  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:155:35: error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, std::size_t chunk_size);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:162:35: error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, bool auto_delete = false);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:176:26: error: 'path' is unavailable: introduced in macOS 10.15
  const std::filesystem::path& path() const {
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:190:36: error: 'path' is unavailable: introduced in macOS 10.15
  bool Move(const std::filesystem::path& new_path);
                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:193:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
make[2]: *** [webcc/CMakeFiles/webcc.dir/build.make:93: webcc/CMakeFiles/webcc.dir/body.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/miles/webcc/webcc/client_pool.cc:1:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:161:53: error: 'path' is unavailable: introduced in macOS 10.15
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
                             const std::filesystem::path& path,In file included from
/Users/miles/webcc/webcc/client_session.h:                                                    ^7
:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem::9739:
:In file included from 24/Users/miles/webcc/webcc/body.h:: 10:
note: 'path' /Users/miles/webcc/webcc/common.hhas: 161been:
53      :explicitly  marked errorunavailable:  here
'path' is unavailable: introduced in class _LIBCPP_TYPE_VIS path {macOS
 10.15                       ^

                             const std::filesystem::path& path,
                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_pool.cc:1:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from /Users/miles/webcc/webcc/body.h:10:
/Users/miles/webcc/webcc/common.h:232:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739In file included from :/Users/miles/webcc/webcc/client_session.cc24:: 1:
In file included from note/Users/miles/webcc/webcc/client_session.h: :7'path':
 In file included from has/Users/miles/webcc/webcc/client_pool.h :been7
:
      In file included from explicitly/Users/miles/webcc/webcc/client.h :marked14 :
unavailable In file included from here/Users/miles/webcc/webcc/request.h:
8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from class _LIBCPP_TYPE_VIS path {/Users/miles/webcc/webcc/body.h
:10                       ^:

/Users/miles/webcc/webcc/common.h:232:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
In file included from /Users/miles/webcc/webcc/client_pool.cc/Users/miles/webcc/webcc/body.h::1155:
:In file included from 35/Users/miles/webcc/webcc/client_pool.h:: 7:
In file included from error/Users/miles/webcc/webcc/client.h: :14:
In file included from 'path'/Users/miles/webcc/webcc/request.h :is8 :
unavailable:In file included from  /Users/miles/webcc/webcc/message.hintroduced: 9in:
 macOS/Users/miles/webcc/webcc/body.h :15510.15:35
: error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, std::size_t chunk_size);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24:   FileBody(const std::filesystem::path& path, std::size_t chunk_size);
note                                  ^:
'path' has been
      explicitly/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem :marked739 :unavailable24 :here
note: 'path' hasclass _LIBCPP_TYPE_VIS path {
been
                       ^
explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from In file included from /Users/miles/webcc/webcc/client_pool.cc/Users/miles/webcc/webcc/message.h::19:
:
In file included from /Users/miles/webcc/webcc/client_pool.h/Users/miles/webcc/webcc/body.h::7162:
:In file included from 35/Users/miles/webcc/webcc/client.h::14 :
In file included from /Users/miles/webcc/webcc/request.herror:: 8:
In file included from 'path'/Users/miles/webcc/webcc/message.h :is9 :
unavailable: /Users/miles/webcc/webcc/body.hintroduced: 162in: 35macOS:  10.15
error: 'path' is unavailable: introduced in macOS 10.15
  FileBody(const std::filesystem::path& path, bool auto_delete = false);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24:   FileBody(const std::filesystem::path& path, bool auto_delete = false);note
:                                   ^'path'
 has been
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem      :explicitly739 :marked24 :unavailable  herenote
: 'path' has been
class _LIBCPP_TYPE_VIS path {
explicitly                        ^marked
 unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from In file included from /Users/miles/webcc/webcc/client_pool.cc/Users/miles/webcc/webcc/client.h::114:
:
In file included from In file included from /Users/miles/webcc/webcc/client_pool.h/Users/miles/webcc/webcc/request.h::78:
:
In file included from In file included from /Users/miles/webcc/webcc/client.h/Users/miles/webcc/webcc/message.h::149:
:
In file included from /Users/miles/webcc/webcc/body.h/Users/miles/webcc/webcc/request.h::1768::
26In file included from :/Users/miles/webcc/webcc/message.h error: 'path' is unavailable: introduced in :macOS 10.15
  const std::filesystem::path& path() const {
                         ^
9/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: :
note: 'path' /Users/miles/webcc/webcc/body.hhas been
      explicitly marked unavailable :here176
:26: error: class _LIBCPP_TYPE_VIS path {'path'
 is                        ^unavailable:
 introduced in macOS 10.15
  const std::filesystem::path& path() const {
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: noteIn file included from : /Users/miles/webcc/webcc/client_session.cc:'path'1 :
hasIn file included from  /Users/miles/webcc/webcc/client_session.hbeen:
7      :
explicitlyIn file included from  /Users/miles/webcc/webcc/client_pool.h:marked7 :
unavailableIn file included from  /Users/miles/webcc/webcc/client.hhere:14
:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
class _LIBCPP_TYPE_VIS path {
/Users/miles/webcc/webcc/body.h:                       ^190
:36: error: 'path' is unavailable: introduced in macOS 10.15
  bool Move(const std::filesystem::path& new_path);
                                   ^
In file included from /Users/miles/webcc/webcc/client_pool.cc:1/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:
:In file included from /Users/miles/webcc/webcc/client_pool.h739::724:
:In file included from  /Users/miles/webcc/webcc/client.h:14:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from note/Users/miles/webcc/webcc/message.h:9:
: /Users/miles/webcc/webcc/body.h:190'path': 36has:  been
      errorexplicitly:  marked 'path'unavailable  ishere unavailable:
 introduced in macOS 10.15
class _LIBCPP_TYPE_VIS path {
                       ^
  bool Move(const std::filesystem::path& new_path);
                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      In file included from explicitly/Users/miles/webcc/webcc/client_session.cc :marked1 unavailable :
hereIn file included from /Users/miles/webcc/webcc/client_session.h
:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:class _LIBCPP_TYPE_VIS path {14
:
In file included from                        ^/Users/miles/webcc/webcc/request.h
:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
/Users/miles/webcc/webcc/body.h:193:20: error: 'path'In file included from  /Users/miles/webcc/webcc/client_pool.ccis: 1unavailable::
 In file included from introduced/Users/miles/webcc/webcc/client_pool.h :in7 :
macOSIn file included from  /Users/miles/webcc/webcc/client.h10.15:14
:
In file included from /Users/miles/webcc/webcc/request.h:8:
In file included from /Users/miles/webcc/webcc/message.h:9:
  std::filesystem::path path_;/Users/miles/webcc/webcc/body.h
:193                   ^:
20: error/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem: :739:'path'24 :is  unavailable: noteintroduced:  in'path'  macOShas  10.15been

      explicitly marked unavailable here
  std::filesystem::path path_;
                   ^
class _LIBCPP_TYPE_VIS path {
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem                       ^:
739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:86:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path temp_path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:66:12: error: 'path' is unavailable: introduced in macOS 10.15
  explicit FileBodyHandler(Message* message) : BodyHandler(message) {
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:763:29: note: 'path' has been
      explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY path() noexcept {}
                            ^
In file included from /Users/miles/webcc/webcc/client.cc:1:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:66:12: error: '~path' is unavailable: introduced in macOS 10.15
  explicit FileBodyHandler(Message* message) : BodyHandler(message) {
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been
      explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:86:20: error: 'path' is unavailable: introduced in macOS 10.15
In file included from   std::filesystem::path temp_path_;
/Users/miles/webcc/webcc/client_pool.cc:                   ^1
:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem::16739:
:In file included from 24/Users/miles/webcc/webcc/response_parser.h:: 6:
note: /Users/miles/webcc/webcc/parser.h:'path'86 :has20 :been
      explicitlyerror : marked unavailable 'path'here is
 unavailable: introduced in macOS 10.15class _LIBCPP_TYPE_VIS path {

                       ^
  std::filesystem::path temp_path_;
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:7:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:66:12: error: 'path' is unavailable: introduced in macOS 10.15
In file included from /Users/miles/webcc/webcc/client_pool.cc:1:
In file included from /Users/miles/webcc/webcc/client_pool.h:7:
In file included from /Users/miles/webcc/webcc/client.h:16:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h  explicit FileBodyHandler(Message* message) : BodyHandler(message) {:
66:           ^12
: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem'path': 763is: 29unavailable::  introduced innote : macOS 'path'10.15 has
 been
      explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY path() noexcept {}
                            ^
  explicit FileBodyHandler(Message* message) : BodyHandler(message) {
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:763:29: noteIn file included from : /Users/miles/webcc/webcc/client_session.cc:1'path':
 In file included from has/Users/miles/webcc/webcc/client_session.h :been7
:
      In file included from explicitly/Users/miles/webcc/webcc/client_pool.h :marked7 :
unavailableIn file included from  /Users/miles/webcc/webcc/client.hhere:16
:
In file included from /Users/miles/webcc/webcc/response_parser.h:6:
/Users/miles/webcc/webcc/parser.h:66:12:   _LIBCPP_INLINE_VISIBILITY path() noexcept {}error
:                             ^
'~path' is unavailable: introduced in macOS 10.15
In file included from /Users/miles/webcc/webcc/client_pool.cc:1  explicit FileBodyHandler(Message* message) : BodyHandler(message) {:

In file included from /Users/miles/webcc/webcc/client_pool.h           ^:
7:
In file included from /Users/miles/webcc/webcc/client.h:16/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:
:In file included from 791/Users/miles/webcc/webcc/response_parser.h::36::
 /Users/miles/webcc/webcc/parser.h:note66: :12'~path':  has beenerror
:       explicitly '~path'marked  isunavailable  unavailable:here introduced
 in macOS 10.15  ~path() = default;

  ^
  explicit FileBodyHandler(Message* message) : BodyHandler(message) {
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been
      explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/miles/webcc/webcc/client.cc:3:
/Users/miles/webcc/webcc/logger.h:52:37: error: 'path' is unavailable: introduced in macOS 10.15
void LogInit(const std::filesystem::path& dir, int modes);
                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:8:
/Users/miles/webcc/webcc/request_builder.h:132:47: error: 'path' is unavailable: introduced in macOS 10.15
  RequestBuilder& File(const std::filesystem::path& path,
                                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:1:
In file included from /Users/miles/webcc/webcc/client_session.h:8:
/Users/miles/webcc/webcc/request_builder.h:144:51: error: 'path' is unavailable: introduced in macOS 10.15
                           const std::filesystem::path& path,
                                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_pool.cc:3:
/Users/miles/webcc/webcc/logger.h:52:37: error: 'path' is unavailable: introduced in macOS 10.15
void LogInit(const std::filesystem::path& dir, int modes);
                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:4:
/Users/miles/webcc/webcc/logger.h:52:37: error: 'path' is unavailable: introduced in macOS 10.15
void LogInit(const std::filesystem::path& dir, int modes);
                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:6:
/Users/miles/webcc/webcc/utility.h:31:45: error: 'path' is unavailable: introduced in macOS 10.15
std::size_t TellSize(const std::filesystem::path& path);
                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/miles/webcc/webcc/client_session.cc:6:
/Users/miles/webcc/webcc/utility.h:34:38: error: 'path' is unavailable: introduced in macOS 10.15
bool ReadFile(const std::filesystem::path& path, std::string* output);
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been
      explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
11 errors generated.
make[2]: *** [webcc/CMakeFiles/webcc.dir/build.make:119: webcc/CMakeFiles/webcc.dir/client_pool.cc.o] Error 1
15 errors generated.
make[2]: *** [webcc/CMakeFiles/webcc.dir/build.make:132: webcc/CMakeFiles/webcc.dir/client_session.cc.o] Error 1
11 errors generated.
make[2]: *** [webcc/CMakeFiles/webcc.dir/build.make:106: webcc/CMakeFiles/webcc.dir/client.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:252: webcc/CMakeFiles/webcc.dir/all] Error 2
make: *** [Makefile:158: all] Error 2

是10.14和10.15有啥不一样么。。

webcc 头文件报错

大哥,你好,我安装你的指示,生成了webcc.lib 和include文件夹,使用的时候加入了include下头文件编译出现了很多错误,请问什么原因
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(88): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(88): error C2535: “void webcc::Message::SetContentType(void)”: 已经定义或声明成员函数
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(82): note: 参见“webcc::Message::SetContentType”的声明
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(29): error C3867: “webcc::Message::start_line”: 非标准语法;请使用 "&" 来创建指向成员的指针
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(29): error C3861: “ToString”: 找不到标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(33): error C2660: “webcc::Headers::Set”: 函数不接受 2 个参数
[build] m:\c++pro\qdlocalbomdll\webcc/common.h(32): note: 参见“webcc::Headers::Set”的声明
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(37): error C2065: “key”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(37): error C2065: “value”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(41): error C2065: “key”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(41): error C2065: “existed”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(45): error C2065: “key”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/message.h(83): error C2065: “content_type”: 未声明的标识符
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(20): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(21): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(22): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(23): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(28): error C2061: 语法错误: 标识符“string_view”
[build] m:\c++pro\qdlocalbomdll\webcc/url.h(28): fatal error C1003: 错误计数超过 100;正在停止编译

Transfer-Encoding: chunked" not handled properly

HttpParser assumes that the Content-Length would always be present in the response, which is not the case if the Transfer-Encoding is "chunked" - and they are mutually exclusive.
If the server returned a "chunked" Transfer-Encoding, the end result is an empty response.

https rest clients/servers

Hi Just having a look at the code in order to do a GET to a https endpoint would i need to do the following (assuming async).

  1. create http_ssl_async_client.{cc,h} files which point to http_ssl_client.{cc,h}
  2. create rest_async_client.{cc,h} which points to http_ssl_async_client.{cc,h}

Am i on the correct track?

Many thanks!

error: ‘webcc::HttpStatus’ has not been declared

Can some one give any idea?
while doing CMake getting this.

In member function ‘virtual void ConfigServerDefault::Get(const webcc::UrlQuery&, webcc::RestResponse*)’: /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:19:35: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kOK; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp: In member function ‘virtual void ConfigServerResponse::Get(const UrlSubMatches&, const webcc::UrlQuery&, webcc::RestResponse*)’: /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:31:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kBadRequest; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:43:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kNotFound; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:47:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kOK;

License is missing

Good project. We might be wanting to use it. Could you put a license on this? Preferably one that makes it possible for us to use in a commercial product where we need to have closed source, so LGPL, MIT or similar?

如何修改每次只读取1024字节

2020-12-14 12:11:43.173, VERB, main, client.cc, 247, Timer canceled.
2020-12-14 12:11:43.182, INFO, main, client.cc, 208, Read data, length: 1024.
2020-12-14 12:11:43.194, VERB, main, client.cc, 237, Wait timer asynchronously.

Soap Responses

This isn't really an issue just curious about the soap implementation is there a way to handle one way soap MEP's or is the lib solely based on Request-Response.

VS编译标准示例报错无法解析的外部符号

我复制了Readme中的完整客户端例子到VS项目中编译,出现”LNK2001 无法解析的外部符号“错误.(服务端代码不会引起这个错误)
以下为错误内容:

已启动重新生成…
1>------ 已启动全部重新生成: 项目: Application Communication Interface, 配置: Release x64 ------
1>Application Communication Interface.cpp
1>Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
1>- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
1>- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
1>Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertCloseStore
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertEnumCertificatesInStore
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertFreeCertificateContext
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertOpenSystemStoreW
1>F:\Application Communication Interface\x64\Release\Application Communication Interface.exe : fatal error LNK1120: 4 个无法解析的外部命令
1>已完成生成项目“Application Communication Interface.vcxproj”的操作 - 失败。
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

Projects build report:
  Status    | Project [Config|platform]
 -----------|---------------------------------------------------------------------------------------------------
  Failed    | Application Communication Interface\Application Communication Interface.vcxproj [Release|x64]

Build time 00:00:03.553
Build ended at 2022-02-11 14:53:31

图为VS的“错误列表”
image

Very slow response

Hi,

I am testing example/form_server both my Mac Pro and also raspi4 . its super slower than the python (fastapi) ? almost 10 times slower

Why is this ? am I missed something ?

Best

Add as a subdirectory

How could I add webcc as a subdirectory to my cmake project? I tried to do:

add_subdirectory(thirdparty/webcc)
# Later in the CMake
target_link_libraries(main PRIVATE webcc)

But I get errors when I try to include the library saying that that header doesn't exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.