<commit_before>#include "HTTP.hpp"
#include "JobRunner.hpp"
#include "logger.hpp"

#include <iostream>
#include <sstream>

#include <boost/regex.hpp>
#include <boost/algorithm/string/predicate.hpp>

using namespace boost;
using namespace boost::asio::ip; // to get 'tcp::'

bool testGet(asio::io_service& io_service, tcp::resolver& resolver, bool is_ssl, bool toFile, asio::yield_context yield) {
  RESTClient::HTTP server("httpbin.org", io_service, resolver, yield, is_ssl);
  RESTClient::HTTPResponse response;
  if (toFile) {
    std::stringstream fn;
    fn << "tmp-get";
    if (is_ssl)
      fn << "-ssl";
    fn << ".json";
    response = server.getToFile("/get", fn.str());
  } else
    response = server.get("/get");
  // Check it
  std::string shouldContain("httpbin.org/get");<commit_msg>Added a bit more logging<commit_after>#include "HTTP.hpp"
#include "JobRunner.hpp"
#include "logger.hpp"

#include <iostream>
#include <sstream>

#include <boost/regex.hpp>
#include <boost/algorithm/string/predicate.hpp>

using namespace boost;
using namespace boost::asio::ip; // to get 'tcp::'

bool testGet(asio::io_service& io_service, tcp::resolver& resolver, bool is_ssl, bool toFile, asio::yield_context yield) {
  RESTClient::HTTP server("httpbin.org", io_service, resolver, yield, is_ssl);
  RESTClient::HTTPResponse response;
  if (toFile) {
    std::stringstream fn;
    fn << "tmp-get";
    if (is_ssl)
      fn << "-ssl";
    fn << ".json";
    response = server.getToFile("/get", fn.str());
    LOG_DEBUG("testGet - filename: " << fn.str());
  } else {
    response = server.get("/get");
    LOG_DEBUG("testGet - no file: ");
  }
  // Check it
  std::string shouldContain("httpbin.org/get");
{'fraction_non_alphanumeric': 0.16842723004694835, 'fraction_numerical': 0.0, 'mean_word_length': 4.378548895899054, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6048391', 'n_tokens_mistral': 589, 'n_tokens_neox': 578, 'n_words': 137}