1309
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2002 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
1005
|
13 |
"{ Package: 'stx:libbasic2' }"
|
|
14 |
|
|
15 |
HierarchicalURI subclass:#HttpURI
|
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
1310
|
19 |
category:'Net-Resources'
|
1005
|
20 |
!
|
|
21 |
|
1309
|
22 |
!HttpURI class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 2002 by eXept Software AG
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
! !
|
1005
|
37 |
|
|
38 |
!HttpURI class methodsFor:'accessing'!
|
|
39 |
|
|
40 |
schemes
|
|
41 |
|
|
42 |
^ #(http)
|
|
43 |
! !
|
|
44 |
|
|
45 |
!HttpURI methodsFor:'defaults'!
|
|
46 |
|
|
47 |
defaultPort
|
|
48 |
|
|
49 |
^ 80
|
|
50 |
! !
|
|
51 |
|
|
52 |
!HttpURI methodsFor:'stream access'!
|
|
53 |
|
|
54 |
readStreamDo:aBlock
|
|
55 |
"use HTTPInterface for now"
|
|
56 |
|
|
57 |
|response headerInfo mime|
|
|
58 |
|
|
59 |
response := HTTPInterface get:self path
|
|
60 |
fromHost:self host
|
|
61 |
port:self port
|
|
62 |
accept:#('*/*')
|
|
63 |
fromDocument:nil.
|
|
64 |
|
|
65 |
headerInfo := response headerInfo.
|
|
66 |
mime := headerInfo at:'content-type' ifAbsent:nil.
|
|
67 |
mime notNil ifTrue:[
|
|
68 |
headerInfo at:#MIME put:mime.
|
|
69 |
].
|
|
70 |
aBlock value:response data readStream value:headerInfo
|
|
71 |
|
|
72 |
"
|
|
73 |
'http://www.exept.de/' asURI readStreamDo:[:stream :attributes |
|
|
74 |
self halt
|
|
75 |
].
|
|
76 |
"
|
|
77 |
! !
|
|
78 |
|
1276
|
79 |
!HttpURI methodsFor:'testing'!
|
|
80 |
|
1461
|
81 |
isAbsolute
|
|
82 |
"there is nothing like a relative http URI"
|
|
83 |
|
|
84 |
^ true
|
|
85 |
!
|
|
86 |
|
1276
|
87 |
isRemote
|
|
88 |
"return true, if this is a remote URI"
|
|
89 |
|
|
90 |
^ true
|
|
91 |
! !
|
|
92 |
|
1005
|
93 |
!HttpURI class methodsFor:'documentation'!
|
|
94 |
|
|
95 |
version
|
1461
|
96 |
^ '$Header: /cvs/stx/stx/libbasic2/HttpURI.st,v 1.5 2004-07-03 06:27:24 stefan Exp $'
|
1005
|
97 |
! !
|