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
4cdcef7e
Kaydet (Commit)
4cdcef7e
authored
Haz 22, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
discard endrequest(); minor stuff; rfc822 no seek flag
üst
2d95706f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
httplib.py
Lib/httplib.py
+4
-6
No files found.
Lib/httplib.py
Dosyayı görüntüle @
4cdcef7e
...
...
@@ -12,6 +12,7 @@
# >>> h.putreqest('GET', '/index.html')
# >>> h.putheader('Accept', 'text/html')
# >>> h.putheader('Accept', 'text/plain')
# >>> h.endheaders()
# >>> errcode, errmsg, headers = h.getreply()
# >>> if errcode == 200:
# ... f = h.getfile()
...
...
@@ -67,6 +68,7 @@ class HTTP:
self
.
sock
.
send
(
str
)
def
putrequest
(
self
,
request
,
selector
):
if
not
selector
:
selector
=
'/'
str
=
'
%
s
%
s
%
s
\r\n
'
%
(
request
,
selector
,
HTTP_VERSION
)
self
.
send
(
str
)
...
...
@@ -77,13 +79,9 @@ class HTTP:
def
endheaders
(
self
):
self
.
send
(
'
\r\n
'
)
def
endrequest
(
self
):
if
self
.
debuglevel
>
0
:
print
'shutdown: 1'
self
.
sock
.
shutdown
(
1
)
def
getreply
(
self
):
self
.
endrequest
()
self
.
file
=
self
.
sock
.
makefile
(
'r'
)
self
.
sock
=
None
line
=
self
.
file
.
readline
()
if
self
.
debuglevel
>
0
:
print
'reply:'
,
`line`
if
replyprog
.
match
(
line
)
<
0
:
...
...
@@ -92,7 +90,7 @@ class HTTP:
errcode
,
errmsg
=
replyprog
.
group
(
1
,
2
)
errcode
=
string
.
atoi
(
errcode
)
errmsg
=
string
.
strip
(
errmsg
)
self
.
headers
=
rfc822
.
Message
(
self
.
file
)
self
.
headers
=
rfc822
.
Message
(
self
.
file
,
0
)
return
errcode
,
errmsg
,
self
.
headers
def
getfile
(
self
):
...
...
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