Building samples (original) (raw)

Samples inside EasyHttp are built as a separate CMake project so that to mirror the actual library usage.

Before you can build the samples, first make sure you have EasyHttp installed.

Installing EasyHttp

See Installing EasyHttp

Please note that if you haven't installed library inside the default folders searched by CMake, you might have to provide the installation dir path using CMAKEPREFIXPATH.

Build samples

Assuming you have already have a local copy of easyhttpcpp project cloned.

cd easyhttpcpp/samples
mkdir _build
cd _build
cmake ../
make

This will build all the samples present inside the samples folder.

Run sample

Once built, lets run a given sample, say SimpleHttpClient.

From the _build folder created above,

cd bin
./easyhttpcpp-samples-SimpleHttpClient https://github.com/sony/easyhttpcpp

This will download and print the contents of https://github.com/sony/easyhttpcpp as an html document.

Usage: ./easyhttpcpp-samples-SimpleHttpClient <any-url>