<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Schedutalk.Logic
{
    class HttpRequestor
    {
        public async Task<string> getHttpRequestAsString(Func<string, HttpRequestMessage> requestTask, string input)
        {
            HttpClient httpClient = new HttpClient();
            HttpRequestMessage request = requestTask(input);
            var response = httpClient.SendAsync(request);


            var result = await response.Result.Content.ReadAsStringAsync();
            return result;
        }

    }
}<commit_msg>Implement utlity for requesting JSON as string<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Schedutalk.Logic
{
    class HttpRequestor
    {
        public async Task<string> getHttpRequestAsString(Func<string, HttpRequestMessage> requestTask, string input)
        {
            HttpClient httpClient = new HttpClient();
            HttpRequestMessage request = requestTask(input);
            var response = httpClient.SendAsync(request);


            var result = await response.Result.Content.ReadAsStringAsync();
            return result;
        }

        public string getJSONAsString(Func<string, HttpRequestMessage> requestTask, string placeName)
        {
            Task<string> task = getHttpRequestAsString(requestTask, "E2");

            task.Wait();
            //Format string
            string replacement = task.Result;
            if (0 == replacement[0].CompareTo('[')) replacement = replacement.Substring(1);
            if (0 == replacement[replacement.Length - 1].CompareTo(']')) replacement = replacement.Remove(replacement.Length - 1);

            return replacement;
        }
    }
}
{'fraction_non_alphanumeric': 0.09172852598091198, 'fraction_numerical': 0.003711558854718982, 'mean_word_length': 2.8198380566801617, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4226040', 'n_tokens_mistral': 485, 'n_tokens_neox': 475, 'n_words': 117}