Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8e97fbf3
Kaydet (Commit)
8e97fbf3
authored
Mar 09, 2005
tarafından
Skip Montanaro
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Correct description/example of how to override User-agent.
üst
e2713bec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
liburllib.tex
Doc/lib/liburllib.tex
+4
-4
No files found.
Doc/lib/liburllib.tex
Dosyayı görüntüle @
8e97fbf3
...
...
@@ -160,8 +160,8 @@ can be accomplished with the following code:
import urllib
class AppURLopener(urllib.FancyURLopener):
version = "App/1.7"
def
__
init
__
(self, *args):
self.version = "App/1.7"
urllib.FancyURLopener.
__
init
__
(self, *args)
urllib.
_
urlopener = AppURLopener()
...
...
@@ -243,9 +243,9 @@ By default, the \class{URLopener} class sends a
\mailheader
{
User-Agent
}
header of
\samp
{
urllib/
\var
{
VVV
}}
, where
\var
{
VVV
}
is the
\module
{
urllib
}
version number. Applications can
define their own
\mailheader
{
User-Agent
}
header by subclassing
\class
{
URLopener
}
or
\class
{
FancyURLopener
}
and setting the
instance
attribute
\member
{
version
}
to an appropriate string value
before
the
\method
{
open()
}
method is called
.
\class
{
URLopener
}
or
\class
{
FancyURLopener
}
and setting the
class
attribute
\member
{
version
}
to an appropriate string value
in
the
subclass definition
.
The optional
\var
{
proxies
}
parameter should be a dictionary mapping
scheme names to proxy URLs, where an empty dictionary turns proxies
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment