ores.http.client

Table of Contents

1. Diagram

ores.http.client component diagram

Figure 1: ores.http.client

2. Summary

ores.http.client is how the system reads an outside HTTP API. The public sources adapter reads the daily rates of central banks through it, and so may any other part that calls out. Its first function is a GET over TLS on Boost.Beast and Boost.Asio, with OpenSSL for TLS, which checks the certificate and the host name and bounds the wait and the size of the body. A caller holds it through the transport interface, so a test hands back stored responses and needs no network. The server parts of ores.http serve requests; this part makes them.

3. Inputs

  • A URL, http or https, and the limits of one request: a timeout and a body size.

4. Outputs

  • A response: the status, the content type and the body; or the reason the request failed: a refused certificate, a timeout, a body over the limit, or a network error.

5. Entry points

  • ores::http::client::transport, the interface a caller holds.
  • ores::http::client::beast_transport, the implementation over the network.

6. Dependencies

  • Boost.Beast, Boost.Asio and Boost.URL.
  • OpenSSL, through Asio's TLS stream, and the system's trusted certificates.

7. See also

8. Build dependencies

What the shared profile cannot know, declared here rather than hand-edited into the generated build file. Each block is spliced into its generated file after the profile's baseline.

find_package(Boost REQUIRED COMPONENTS url)

target_link_libraries(${lib_target_name}
    PUBLIC
        Boost::boost
        Boost::url
    PRIVATE
        OpenSSL::SSL
        OpenSSL::Crypto)
target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        Catch2::Catch2
        OpenSSL::SSL
        OpenSSL::Crypto
        ores.openssl_cleanup
        Threads::Threads)

Emacs 29.3 (Org mode 9.6.15)