<commit_before>use v6;
use HTTP::Request::Common;
use URI::Escape;
use WebService::SOP::V1_1::Util;

unit class WebService::SOP::V1_1::Request::GET;

method create-request(URI :$uri, Hash:D :$params, Str:D :$app-secret --> HTTP::Request) {

    die '`time` is required in params' if not $params<time>:exists;

    my %query = %( $uri.query-form, %$params );
    %query<sig> = create-signature(%query, $app-secret);

    my Str $query-string = (for %query.kv -> $k, $v {
        uri-escape($k) ~ '=' ~ uri-escape($v)
    }).join("&");

    GET(URI.new("{$uri.scheme}://{$uri.host}{$uri.path}?{$query-string}"));
}<commit_msg>GET to use build-query-string<commit_after>use v6;
use HTTP::Request::Common;
use URI::Escape;
use WebService::SOP::V1_1::Util;

unit class WebService::SOP::V1_1::Request::GET;

method create-request(URI :$uri, Hash:D :$params, Str:D :$app-secret --> HTTP::Request) {

    die '`time` is required in params' if not $params<time>:exists;

    my %query = %( $uri.query-form, %$params );
    %query<sig> = create-signature(%query, $app-secret);

    GET(URI.new("{$uri.scheme}://{$uri.host}{$uri.path}?{build-query-string(%query)}"));
}
{'fraction_non_alphanumeric': 0.2236614853195164, 'fraction_numerical': 0.008635578583765112, 'mean_word_length': 4.737623762376238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '5614851', 'n_tokens_mistral': 438, 'n_tokens_neox': 427, 'n_words': 85}