Skip to content

Commit 64f32d7

Browse files
author
Jack M
committed
Updated to use _get_route instead of constructing the URL's manually.
1 parent 595705b commit 64f32d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/WWW/Mailgun.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ sub send {
8484
}
8585
}
8686

87-
my $r = $self->{ua}->post($self->{url}.'messages',Content_Type => 'multipart/form-data', Content => $content);
87+
my $r = $self->{ua}->post(_get_route($self, ['messages']),Content_Type => 'multipart/form-data', Content => $content);
8888

8989
_handle_response($r);
9090

@@ -131,23 +131,23 @@ sub bounces {
131131
sub stats {
132132
my $self = shift;
133133

134-
my $r = $self->{ua}->get($self->{url}.'stats');
134+
my $r = $self->{ua}->get(_get_route($self, ['stats']));
135135
_handle_response($r);
136136
return from_json($r->decoded_content);
137137
}
138138

139139
sub logs {
140140
my $self = shift;
141141

142-
my $r = $self->{ua}->get($self->{url}.'log');
142+
my $r = $self->{ua}->get(_get_route($self, ['log']));
143143
_handle_response($r);
144144
return from_json($r->decoded_content);
145145
}
146146

147147
sub mailboxes {
148148
my $self = shift;
149149

150-
my $r = $self->{ua}->get($self->{url}.'mailboxes');
150+
my $r = $self->{ua}->get(_get_route($self, ['mailboxes']));
151151
_handle_response($r);
152152
return from_json($r->decoded_content);
153153
}

0 commit comments

Comments
 (0)