<commit_before>import { pumlhorse } from '../../PumlhorseGlobal';
import { IScope, IFullScope } from '../IScope';
import * as http from 'http-client-factory';
import enforce from '../../util/enforce';

const verbs = ['get', 'post', 'put', 'delete', 'patch', 'options', 'head'];

export class HttpRequestModule {
    static async makeRequest(verb: string, url: string, data: any, headers: Object, $scope: IScope): Promise<IHttpResponse> {
        enforce(url, 'url').isNotNull().isNotEmpty();

        var client = http.getClient();

        client.addHeader('User-Agent', 'Pumlhorse HTTP Client');

        if (headers != null) {
            for(var x in headers) {
                client.addHeader(x, headers[x]);
            }
        }

        try {
            return await client[verb](url, data)
        }<commit_msg>code cleanup<commit_after>import { pumlhorse } from '../../PumlhorseGlobal';
import { IScope, IFullScope } from '../IScope';
import * as http from 'http-client-factory';
import enforce from '../../util/enforce';

export class HttpRequestModule {
    static async makeRequest(verb: string, url: string, data: any, headers: Object, $scope: IScope): Promise<IHttpResponse> {
        enforce(url, 'url').isNotNull().isNotEmpty();

        var client = http.getClient();

        client.addHeader('User-Agent', 'Pumlhorse HTTP Client');

        if (headers != null) {
            for(var x in headers) {
                client.addHeader(x, headers[x]);
            }
        }

        try {
            return await client[verb](url, data)
        }
{'fraction_non_alphanumeric': 0.15159235668789808, 'fraction_numerical': 0.0, 'mean_word_length': 2.594965675057208, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '785102', 'n_tokens_mistral': 459, 'n_tokens_neox': 452, 'n_words': 124}