Skip to content

Commit

Permalink
Fix timdorr#594: 406 Error
Browse files Browse the repository at this point in the history
The Tesla API now complains if we don't set the Accept header.
  • Loading branch information
distler authored Jul 10, 2022
1 parent 89b3a22 commit 17a3c69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/tesla_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def initialize(
# conn.response :logger, nil, {headers: true, bodies: true}
conn.request :json
conn.response :json
conn.headers['Accept'] = 'application/json'
conn.response :raise_error
conn.request :retry, retry_options if retry_options # Must be registered after :raise_error
conn.adapter Faraday.default_adapter
Expand Down

0 comments on commit 17a3c69

Please sign in to comment.