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

"Bad Request for url" when calling get_field (from pull.py) #23

Open
Anton-V-K opened this issue Nov 9, 2022 · 0 comments
Open

"Bad Request for url" when calling get_field (from pull.py) #23

Anton-V-K opened this issue Nov 9, 2022 · 0 comments

Comments

@Anton-V-K
Copy link

Anton-V-K commented Nov 9, 2022

The module uses wrong url like https://api.thingspeak.com/channels/CHANNEL/fields/field1.json instead of https://api.thingspeak.com/channels/CHANNEL/fields/1.json in thingspeak.Channel.get_field.

...>python pull.py
Traceback (most recent call last):
  File "D:\Anton\Devel\arduino-dev\ComfortMon\scripts\pull.py", line 15, in <module>
    print(channel.get_field(field="field1", options={"results": 2}))
  File "C:\Program Files\Python39\lib\site-packages\thingspeak\__init__.py", line 53, in get_field
    return self._fmt(r)
  File "C:\Program Files\Python39\lib\site-packages\thingspeak\__init__.py", line 120, in _fmt
    r.raise_for_status()
  File "C:\Program Files\Python39\lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.thingspeak.com/channels/143461/fields/field1.json?results=
2&api_key=????????????????
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

1 participant