tree: a822bdff39debf27893ba8967deef997b847e486 [path history] [tgz]
  1. client.cpp
  2. README.md
http/get_simple/cpp/client/README.md

HTTP GET Arrow Data: Simple C++ Client Example

This directory contains a minimal example of an HTTP client implemented in C++. The client:

  1. Sends an HTTP GET request to a server.
  2. Receives an HTTP 200 response from the server, with the response body containing an Arrow IPC stream of record batches.
  3. Collects the record batches as they are received.

To run this example, first start one of the server examples in the parent directory. Then install the arrow and libcurl C++ libraries, compile client.cpp, and run the executable. For example, using clang++:

clang++ client.cpp -std=c++17 $(pkg-config --cflags --libs arrow libcurl) -o client
./client

[!NOTE] The example here requires version 15.0.0 or higher of the Arrow C++ library because of a bug (#39163) that existed in earlier versions. If you must use an earlier version of the Arrow C++ library, it is possible to implement an HTTP client by using arrow::ipc::RecordBatchStreamReader instead of arrow::ipc::StreamDecoder. See this example for reference.