HTTPError: 400 Client Error: Bad Request for url: https://api.cloudflare.com/client/v4/zones
See original GitHub issueI’m configuring dehydrated with CloudFlare but getting following error. I would be very happy if anyone can quick help.
ENV-
Python-3.5
+ CloudFlare hook executing: deploy_challenge
Traceback (most recent call last):
File "/opt/dehydrated/hooks/cloudflare/hook.py", line 206, in <module>
main(sys.argv[1:])
File "/opt/dehydrated/hooks/cloudflare/hook.py", line 203, in main
ops[argv[0]](argv[1:])
File "/opt/dehydrated/hooks/cloudflare/hook.py", line 167, in create_all_txt_records
create_txt_record(args[i:i+X])
File "/opt/dehydrated/hooks/cloudflare/hook.py", line 105, in create_txt_record
zone_id = _get_zone_id(domain)
File "/opt/dehydrated/hooks/cloudflare/hook.py", line 82, in _get_zone_id
r.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.cloudflare.com/client/v4/zones?name=space
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Cloudflare API returns error 400 Bad Request
Hey everyone, I am using the cloudflare API in a nodeJS app I am ... await axios .post( 'https://api.cloudflare.com/client/v4/zones', ...
Read more >Issues - GitHub
400 Client Error : Bad Request for url: https://api.cloudflare.com/client/v4/zones/... #23. 3dluvr opened this issue on Oct 11 ...
Read more >Cloudflare API returns error 400 Bad Request - Stack Overflow
I was running into a similar issue with Cloudflare using PHP/cURL to perform a PUT request. I was using: curl_setopt($ch, CURLOPT_PUT, true);.
Read more >400 Bad Request Error: What It Is and How to Fix It
The 400 Bad Request Error is an HTTP response status code indicating that the server was unable to process the request sent by...
Read more >Cloudflare API Error: Exceeded 30 tag limit per API request
... error: `DELETE https://api.cloudflare.com/client/v4/zones/1ac7a798951d625d26eb2b4f4c607978/purge_cache` resulted in a `400 Bad Request` ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix for this is to do this.
Change https://github.com/kappataumu/letsencrypt-cloudflare-hook/blob/master/hook.py#L21
To:
import tld
And change: https://github.com/kappataumu/letsencrypt-cloudflare-hook/blob/master/hook.py#L79
To:
tld = tld.get_fld('http://' + domain)
Thanks @YasharF for that! It is working fine for me without any changes (just swapped old version with yours).