Tôi đang cố truy xuất một người dùng có mã sau được tìm thấy trong số gdata provisioning api documentation. Tôi đang cố gắng này cho một ứng dụng django 1.3
, chạy gdata-2.0.16
trong python2.7
:"Yêu cầu HTTP không an toàn không được phép. Sử dụng HTTPS". khi cố gắng truy xuất người dùng bằng thư viện python gdata 2.0.16
from gdata.apps import client
from myapp import settings
client = client.AppsClient(domain=settings.GOOGLE_ADMIN_DOMAIN)
client.ClientLogin(email=settings.GOOGLE_ADMIN_EMAIL, password=settings.GOOGLE_ADMIN_PASSWORD, source='apps')
user_account = client.RetrieveUser('user_name')
Đối với sự riêng tư, tôi đã thay đổi tên người dùng thực tế để 'user_name'
, nhưng đó là ý chính nói chung của mã này.
Khi người phiên dịch được đến dòng cuối cùng trong đoạn mã trên, tôi nhận được lỗi sau:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/gdata/apps/client.py", line 182, in RetrieveNickname
return self.GetEntry(uri, desired_class=gdata.apps.data.NicknameEntry)
File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 652, in get_entry
desired_class=desired_class, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 319, in request
RequestError)
RequestError: Server responded with: 403, <HTML>
<HEAD>
<TITLE>Insecure HTTP requests not permitted. Use HTTPS.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Insecure HTTP requests not permitted. Use HTTPS.</H1>
<H2>Error 403</H2>
</BODY>
</HTML>
tôi không thể tìm thấy bất cứ điều gì trong tài liệu về việc sử dụng HTTPS thay vì HTTP. Tôi đang thiếu gì?