Skip to content

wtlgo/Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Total alerts Language grade: C/C++

Network

Simple CURL wrapper for general usage

How to use

  1. Add it to your CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(your_proj)
include(ExternalProject)

set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)

ExternalProject_Add(NetworkDownload
   GIT_REPOSITORY https://github.com/wtlgo/Network.git
   GIT_TAG v4.0.0
   CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)

include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)

add_executable(your_target main.cpp)
target_compile_features(your_target PRIVATE cxx_std_17)
add_dependencies(your_target NetworkDownload)
target_link_libraries(your_target Network)
  1. Use it
#include <iostream>
#include <wtlgo/Network.hpp>

int main() {
    using namespace wtlgo;

    std::cout << network.request("http://httpbin.org/ip") << std::endl;

    return 0;
}
  1. ????
  2. PROFIT