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
5ca3a08c
Kaydet (Commit)
5ca3a08c
authored
Nis 04, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
The rest of the documentation for manual proxy configuration for a basic
urlopen(). This is part of SF patch #523415.
üst
d2167032
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
liburllib.tex
Doc/lib/liburllib.tex
+20
-3
No files found.
Doc/lib/liburllib.tex
Dosyayı görüntüle @
5ca3a08c
...
@@ -18,7 +18,7 @@ operations are available.
...
@@ -18,7 +18,7 @@ operations are available.
It defines the following public functions:
It defines the following public functions:
\begin{funcdesc}
{
urlopen
}{
url
\optional
{
, data
}}
\begin{funcdesc}
{
urlopen
}{
url
\optional
{
, data
\optional
{
, proxies
}
}}
Open a network object denoted by a URL for reading. If the URL does
Open a network object denoted by a URL for reading. If the URL does
not have a scheme identifier, or if it has
\file
{
file:
}
as its scheme
not have a scheme identifier, or if it has
\file
{
file:
}
as its scheme
identifier, this opens a local file; otherwise it opens a socket to a
identifier, this opens a local file; otherwise it opens a socket to a
...
@@ -84,6 +84,23 @@ section.
...
@@ -84,6 +84,23 @@ section.
In a Macintosh environment,
\function
{
urlopen()
}
will retrieve proxy
In a Macintosh environment,
\function
{
urlopen()
}
will retrieve proxy
information from Internet
\index
{
Internet Config
}
Config.
information from Internet
\index
{
Internet Config
}
Config.
Alternatively, the optional
\var
{
proxies
}
argument may be used to
explicitly specify proxies. It must be a dictionary mapping scheme
names to proxy URLs, where an empty dictionary causes no proxies to be
used, and
\code
{
None
}
(the default value) causes environmental proxy
settings to be used as discussed above. For example:
\begin{verbatim}
# Use http://www.someproxy.com:3128 for http proxying
proxies = proxies=
{
'http': 'http://www.someproxy.com:3128'
}
filehandle = urllib.urlopen(some
_
url, proxies=proxies)
# Don't use any proxies
filehandle = urllib.urlopen(some
_
url, proxies=
{}
)
# Use proxies from environment - both versions are equivalent
filehandle = urllib.urlopen(some
_
url, proxies=None)
filehandle = urllib.urlopen(some
_
url)
\end{verbatim}
The
\function
{
urlopen()
}
function does not support explicit proxy
The
\function
{
urlopen()
}
function does not support explicit proxy
specification. If you need to override environmental proxy settings,
specification. If you need to override environmental proxy settings,
use
\class
{
URLopener
}
, or a subclass such as
\class
{
FancyURLopener
}
.
use
\class
{
URLopener
}
, or a subclass such as
\class
{
FancyURLopener
}
.
...
@@ -205,7 +222,7 @@ attribute \member{version} to an appropriate string value before the
...
@@ -205,7 +222,7 @@ attribute \member{version} to an appropriate string value before the
The optional
\var
{
proxies
}
parameter should be a dictionary mapping
The optional
\var
{
proxies
}
parameter should be a dictionary mapping
scheme names to proxy URLs, where an empty dictionary turns proxies
scheme names to proxy URLs, where an empty dictionary turns proxies
off completely. Its default value is
None
, in which case
off completely. Its default value is
\code
{
None
}
, in which case
environmental proxy settings will be used if present, as discussed in
environmental proxy settings will be used if present, as discussed in
the definition of
\function
{
urlopen()
}
, above.
the definition of
\function
{
urlopen()
}
, above.
...
@@ -314,7 +331,7 @@ Overridable interface to open unknown URL types.
...
@@ -314,7 +331,7 @@ Overridable interface to open unknown URL types.
Retrieves the contents of
\var
{
url
}
and places it in
\var
{
filename
}
. The
Retrieves the contents of
\var
{
url
}
and places it in
\var
{
filename
}
. The
return value is a tuple consisting of a local filename and either a
return value is a tuple consisting of a local filename and either a
\class
{
mimetools.Message
}
object containing the response headers (for remote
\class
{
mimetools.Message
}
object containing the response headers (for remote
URLs) or
None
(for local URLs). The caller must then open and read the
URLs) or
\code
{
None
}
(for local URLs). The caller must then open and read the
contents of
\var
{
filename
}
. If
\var
{
filename
}
is not given and the URL
contents of
\var
{
filename
}
. If
\var
{
filename
}
is not given and the URL
refers to a local file, the input filename is returned. If the URL is
refers to a local file, the input filename is returned. If the URL is
non-local and
\var
{
filename
}
is not given, the filename is the output of
non-local and
\var
{
filename
}
is not given, the filename is the output of
...
...
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