DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
post.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_HTTP_POST_H
13 #define DOCWIRE_HTTP_POST_H
14 
15 #include "chain_element.h"
16 #include "http_export.h"
17 #include <filesystem>
18 #include <map>
19 
20 namespace docwire
21 {
22 
24 {
25  std::filesystem::path v;
26  explicit default_file_name(const std::filesystem::path& p)
27  : v(p) {}
28 };
29 
30 namespace http
31 {
32 
33 struct ssl_verify_peer { bool v; };
34 
35 class DOCWIRE_HTTP_EXPORT post : public chain_element, public with_pimpl<post>
36 {
37 public:
38  post(const std::string& url, const std::string& oauth2_bearer_token = "", ssl_verify_peer ssl_verify_peer_v = {true});
39  post(const std::string& url, const std::map<std::string, std::string>& form, const std::string& pipe_field_name, const default_file_name& default_file_name, const std::string& oauth2_bearer_token = "", ssl_verify_peer ssl_verify_peer_v = {true});
40 
48  virtual continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
49 
50  bool is_leaf() const override
51  {
52  return false;
53  }
54 
55 private:
57 };
58 
59 } // namespace http
60 } // namespace docwire
61 
62 #endif //DOCWIRE_HTTP_POST_H
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
Definition: post.h:50
virtual continuation operator()(message_ptr msg, const message_callbacks &emit_message) override
Executes transform for the given message; consumes msg.
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19