Skip to content

Commit

Permalink
Merge pull request #12 from jankratochvil/header
Browse files Browse the repository at this point in the history
Send new header to make it compatible with 'charge_history'.
  • Loading branch information
stevieb9 authored Mar 29, 2023
2 parents 2696b3a + 566e5c5 commit 50dba1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Tesla/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ sub api {

my $url = $self->uri(URL_API . $uri);

my $header = ['Content-Type' => 'application/json; charset=UTF-8'];
my $header = [
'Content-Type' => 'application/json; charset=UTF-8',
# This header is required for charge_history.
'X-Tesla-User-Agent' => 'TeslaApp/4.10.0',
];

if ($auth) {
my $token_string = "Bearer " . $self->_access_token;
Expand Down

0 comments on commit 50dba1f

Please sign in to comment.