<commit_before>package Flickr::API::Request;

use strict;
use warnings;
use HTTP::Request;
use URI;
use Encode qw(encode_utf8);

our @ISA = qw(HTTP::Request);
our $VERSION = '0.03';

sub new {
	my $class = shift;
	my $options = shift;
	my $self = HTTP::Request->new;
	$self->{api_method}	= $options->{method};
	$self->{api_args}	= $options->{args};
	$self->{rest_uri}	= $options->{rest_uri} || 'http://api.flickr.com/services/rest/';
	$self->{unicode}	= $options->{unicode} || 0;

	bless $self, $class;

	$self->method('POST');
        $self->uri($self->{rest_uri});

	return $self;
}

sub encode_args {
	my ($self) = @_;

	my $url = URI->new('http:');

	if ($self->{unicode}){
		for my $k(keys %{$self->{api_args}}){
			$self->{api_args}->{$k} = encode_utf8($self->{api_args}->{$k});<commit_msg>Use more HTTPS now that Flickr's API has stopped supporting HTTP<commit_after>package Flickr::API::Request;

use strict;
use warnings;
use HTTP::Request;
use URI;
use Encode qw(encode_utf8);

our @ISA = qw(HTTP::Request);
our $VERSION = '0.03';

sub new {
	my $class = shift;
	my $options = shift;
	my $self = HTTP::Request->new;
	$self->{api_method}	= $options->{method};
	$self->{api_args}	= $options->{args};
	$self->{rest_uri}	= $options->{rest_uri} || 'https://api.flickr.com/services/rest/';
	$self->{unicode}	= $options->{unicode} || 0;

	bless $self, $class;

	$self->method('POST');
        $self->uri($self->{rest_uri});

	return $self;
}

sub encode_args {
	my ($self) = @_;

	my $url = URI->new('https:');

	if ($self->{unicode}){
		for my $k(keys %{$self->{api_args}}){
			$self->{api_args}->{$k} = encode_utf8($self->{api_args}->{$k});
{'fraction_non_alphanumeric': 0.235258358662614, 'fraction_numerical': 0.00729483282674772, 'mean_word_length': 4.617747440273037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, 'https://': 1, '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': '3068828', 'n_tokens_mistral': 694, 'n_tokens_neox': 659, 'n_words': 133}