Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requests.exceptions.HTTPError: 403 Client Error #66

Open
gickowtf opened this issue Jun 10, 2023 · 5 comments
Open

requests.exceptions.HTTPError: 403 Client Error #66

gickowtf opened this issue Jun 10, 2023 · 5 comments

Comments

@gickowtf
Copy link

gickowtf commented Jun 10, 2023

Hi,

I try to use this nice Modul... but I ever get an error like this:

Traceback (most recent call last): File "/Users/mb/PycharmProjects/Test/growatt_test.py", line 35, in <module> login_response = api.login(username, user_pass) File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/growattServer/__init__.py", line 131, in login response = self.session.post(self.get_url('newTwoLoginAPI.do'), data={ File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/requests/sessions.py", line 710, in send r = dispatch_hook("response", hooks, r, **kwargs) File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/requests/hooks.py", line 30, in dispatch_hook _hook_data = hook(hook_data, **kwargs) File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/growattServer/__init__.py", line 41, in <lambda> 'response': lambda response, *args, **kwargs: response.raise_for_status() File "/Users//.conda/envs/untitled/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://server-api.growatt.com/newTwoLoginAPI.do

what i do wrong?! Please Help me.

@gickowtf
Copy link
Author

I did it... its a wrong url in repo. It is Not Server-api.growatt... it is Server.growatt...

@Aung-Myint-Thein
Copy link

Aung-Myint-Thein commented Jul 18, 2023

We would need to update the api server_url as following

import growattServer

api = growattServer.GrowattApi()
api.server_url = 'https://server.growatt.com/'
login_response = api.login(<username>, <password>)
#Get a list of growatt plants.
print(api.plant_list(login_response['user']['id']))

@APKing1
Copy link

APKing1 commented Sep 30, 2023

Since 28th September, can't login at server.growatt.com

Getting requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://server.growatt.com/newTwoLoginAPI.do

@ryandrake182
Copy link

Since 28th September, can't login at server.growatt.com

Getting requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://server.growatt.com/newTwoLoginAPI.do

Same issue as this #74

@marcovtwout
Copy link
Contributor

Fixed by #77
@indykoning this issue could be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants