1005
|
1 |
"{ Package: 'stx:libbasic2' }"
|
|
2 |
|
|
3 |
HierarchicalURI subclass:#HttpURI
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Resources'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!HttpURI class methodsFor:'accessing'!
|
|
12 |
|
|
13 |
schemes
|
|
14 |
|
|
15 |
^ #(http)
|
|
16 |
! !
|
|
17 |
|
|
18 |
!HttpURI methodsFor:'defaults'!
|
|
19 |
|
|
20 |
defaultPort
|
|
21 |
|
|
22 |
^ 80
|
|
23 |
! !
|
|
24 |
|
|
25 |
!HttpURI methodsFor:'stream access'!
|
|
26 |
|
|
27 |
readStreamDo:aBlock
|
|
28 |
"use HTTPInterface for now"
|
|
29 |
|
|
30 |
|response headerInfo mime|
|
|
31 |
|
|
32 |
response := HTTPInterface get:self path
|
|
33 |
fromHost:self host
|
|
34 |
port:self port
|
|
35 |
accept:#('*/*')
|
|
36 |
fromDocument:nil.
|
|
37 |
|
|
38 |
headerInfo := response headerInfo.
|
|
39 |
mime := headerInfo at:'content-type' ifAbsent:nil.
|
|
40 |
mime notNil ifTrue:[
|
|
41 |
headerInfo at:#MIME put:mime.
|
|
42 |
].
|
|
43 |
aBlock value:response data readStream value:headerInfo
|
|
44 |
|
|
45 |
"
|
|
46 |
'http://www.exept.de/' asURI readStreamDo:[:stream :attributes |
|
|
47 |
self halt
|
|
48 |
].
|
|
49 |
"
|
|
50 |
! !
|
|
51 |
|
|
52 |
!HttpURI class methodsFor:'documentation'!
|
|
53 |
|
|
54 |
version
|
|
55 |
^ '$Header: /cvs/stx/stx/libbasic2/HttpURI.st,v 1.1 2002-01-17 14:25:37 stefan Exp $'
|
|
56 |
! !
|