HttpURI.st
author Stefan Vogel <sv@exept.de>
Thu, 17 Jan 2002 15:25:48 +0100
changeset 1005 7ed6fa7ccfba
child 1276 fd3f0d37513c
permissions -rw-r--r--
initial checkin

"{ 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 $'
! !