WARequest


Seaside-HTTP

Comment:



Hierarchy:

ProtoObject
Object
WARequest

Summary:

instance variables:

cookies fields headers method nativeRequest url

methods:

instance class
accessing private testing as yet unclassified

Detail:

instance variables:

cookies
inferredType:
UndefinedObject
fields
inferredType:
UndefinedObject
headers
inferredType:
UndefinedObject
method
inferredType:
UndefinedObject
nativeRequest
inferredType:
UndefinedObject
url
inferredType:
UndefinedObject

instance methods:

accessing
at: key

	^ fields at: key
at: key ifAbsent: aBlock

	^ fields at: key ifAbsent: aBlock
cookies

	^ cookies
fields

	^ fields
headerAt: aKey

	^ self headerAt: aKey ifAbsent: []
headerAt: aKey ifAbsent: aBlock

	^ headers at: aKey ifAbsent: aBlock
headers

	^ headers
method

	^ method
nativeRequest

	^ nativeRequest
nativeRequest: aRequest

	nativeRequest _ aRequest
password

	^ self authorization ifNotNilDo: [:auth | auth copyAfter: $:]
url

	^ url
user

	^ self authorization ifNotNilDo: [:auth | auth copyUpTo: $:]

private
authorization

	^ (self headerAt: 'Authorization' ifAbsent: [self headerAt: 'authorization'])
		ifNotNilDo: [:auth | self decodeAuthorization: auth]
decodeAuthorization: aString

	^ SeasidePlatformSupport base64Decode: (aString findTokens: ' ') last
setMethod: methodString url: urlString headers: headDict fields: fieldDict cookies: cookieDict

	method _ methodString.
	url _ urlString.
	headers _ headDict.
	fields _ fieldDict.
	cookies _ cookieDict

testing
isGet

	^ self method asUppercase = 'GET'

class methods:

as yet unclassified
method: methodString url: urlString headers: headDict fields: fieldDict cookies: cookieDict

	^ self new setMethod: methodString url: urlString headers: headDict fields: fieldDict cookies: cookieDict
method: methodString url: urlString headers: headDict fields: fieldDict cookies: cookieDict nativeRequest: anObject

	^ (self method: methodString url: urlString headers: headDict fields: fieldDict cookies: cookieDict)
		nativeRequest: anObject;
		yourself

^top


- made by Dandelion -