HttpURI.st
changeset 1005 7ed6fa7ccfba
child 1276 fd3f0d37513c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HttpURI.st	Thu Jan 17 15:25:48 2002 +0100
@@ -0,0 +1,56 @@
+"{ Package: 'stx:libbasic2' }"
+
+HierarchicalURI subclass:#HttpURI
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Resources'
+!
+
+
+!HttpURI class methodsFor:'accessing'!
+
+schemes
+
+    ^ #(http)
+! !
+
+!HttpURI methodsFor:'defaults'!
+
+defaultPort
+
+    ^ 80
+! !
+
+!HttpURI methodsFor:'stream access'!
+
+readStreamDo:aBlock
+    "use HTTPInterface for now"
+
+    |response headerInfo mime|
+
+    response := HTTPInterface get:self path 
+                    fromHost:self host 
+                    port:self port
+                    accept:#('*/*')  
+                    fromDocument:nil.
+
+    headerInfo := response headerInfo.
+    mime := headerInfo at:'content-type' ifAbsent:nil.
+    mime notNil ifTrue:[
+        headerInfo at:#MIME put:mime.
+    ].
+    aBlock value:response data readStream value:headerInfo
+
+    "
+     'http://www.exept.de/' asURI readStreamDo:[:stream :attributes | 
+         self halt
+      ].
+    "
+! !
+
+!HttpURI class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic2/HttpURI.st,v 1.1 2002-01-17 14:25:37 stefan Exp $'
+! !