![](/img/trans.png)
[英]Python requests.get(URL) returns 404 error when using URL with dot
[英]Python's requests.get(url) for a non dot com domain
我正在嘗試檢查URL是否可用。 我正在執行url=https://myapplication.load
(url,verify = None),其中url=https://myapplication.load
。 是的,該域實際上是.load
,它在我們的VPN中。 網址正常工作,但request.get方法返回連接錯誤。 我的所有其他.com
網址(也都在我們的VPN內)可以與request.get方法配合使用。 難道我做錯了什么? 反正有解決這個問題的方法嗎?
編輯
使用request.get()時遇到的特定錯誤是ERROR:Certificate did not match expected hostname
查看文檔 ,您可以通過以下方式禁用所有驗證:
requests.get('https://host.domain.local', verify=False)
請注意,它指定了False
,並且雖然None
是虛假的,但這不一定會有效,具體取決於檢查的方式:
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> False == False
True
>>> None == False
False
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.