|
Class: HttpRequest (in Comanche)
Object
|
+--Comanche::NetworkRequest
|
+--Comanche::HttpRequest
- Package:
- stx:goodies/webServer/comanche/swiki
- Category:
- Comanche-Kom-Protocol-HTTP
- Version:
- rev:
1.26
date: 2005/12/01 16:09:33
- user: stefan
- file: HttpRequest.st directory: goodies/webServer/comanche/swiki
- module: stx stc-classLibrary: swiki
kom/4.12 (Comanche/4.12)
bolot 2/20/2002 13:53
- rawUrl = the entire request string
- url = rawUrl up to ?
- queryString = rawUrl after the first ?
- rawUrl == url?queryString
HttpRequest (bolot 4/2/2001 18:51)
- HTTP request object wrapper
- handles details of HTTP
-- headers, formats, etc.
- as of kom47, handles multipart posts
- in kom49 (or kom50) a minor refactoring will happen
accessing
-
endOfRequestHeaderMarker
-
This marks the end of an HTTP request (two consecutive CR-LFs)
authentication
-
hashPassword: aPassword
-
-
secretWord
-
a string used in hashing passwords
defaults
-
defaultContentType
-
-
defaultMethod
-
-
defaultProtocol
-
-
defaultUrl
-
initialize-release
-
initialize
-
(comment from inherited method)
called only once - initialize signals
instance creation
-
readFromStream: aStream
-
accessing
-
contentLength
-
-
contentType
-
get rid of charset field
-
cookies
-
answer a dictionary with the cookies in the request
-
endOfRequestHeaderMarker
-
-
getFields
-
retrieve fields encoded in the URL: http://aha/ha?a=1&b=2
-
header
-
-
header: aDict
-
-
host
-
-
localAddress
-
Answer the address of the request originator
-
localPort
-
Answer the address of the request originator
-
method
-
-
method: aString
-
-
multiValueFormFields
-
-
multiValueFormFieldsDisable
-
disable use of multi-value form fields
-
multiValueFormFieldsEnable
-
enable use of multi-value form fields
-
postFields
-
Answer the multipart fields for a post request (if in fact this is a
POST request
-
protocol
-
-
queryString
-
-
queryString: aString
-
-
rawPostFields
-
save the POST form fields as is, for future processing, see #postFields
-
rawUrl
-
-
referer
-
-
remoteAddress
-
-
remoteAddress: aRemoteAddress
-
-
stream
-
-
stream: something
-
-
stxHttpRequest
-
-
stxHttpRequest: something
-
-
timestamp
-
-
timestamp: aTimestamp
-
-
url
-
-
url: aUrl
-
-
user
-
currently, only basic authentication is supported
connection mgt
-
isPersistentConnection
-
defaults
-
defaultContentType
-
-
defaultMethod
-
-
defaultProtocol
-
-
defaultUrl
-
initialize-release
-
destroy
-
-
initRemoteAddress
-
-
initStatusString: aString
-
self protocol: statusLine third
-
initUrl: aString
-
-
initializeFromStream: aStream
-
[(self readRequestHeaderFrom: stream)
-
readRequestHeaderFrom: aStream
-
force reading/parsing post fields
multipart forms
-
multipartBoundary
-
boundary specification in the HTTP header looks like:
Content-Type: multipart/form-data; boundary=BOUNDARY
-
multipartFormFieldsDo: aBlock
-
USAGE:
request multipartFormFieldsDo: [:chunk |
chunk saveToStream: aStream].
-
nextChunkHeader
-
Read the next multipart data chunk's header
printing
-
printOn: printStream
-
(comment from inherited method)
append a user printed representation of the receiver to aStream.
The format is suitable for a human - not meant to be read back.
The default here is to output the receiver's class name.
BUT: this method is heavily redefined for objects which
can print prettier.
-
writeOn: aStream
-
this can be used to form a client-side request and send it over network
private
-
parseCookies: aString
-
PRIVATE: Parse a string in the format:
Cookie: NAME1=OPAQUE_STRING1; NAME2=OPAQUE_STRING2 ...
response
-
badRequest
-
-
redirectTo: aUrl
-
-
unauthorizedFor: realm
-
response cookies
-
responseCookies
-
cookies that need to be set
-
setCookieName: nameString value: valueString expiresDate: expiresDate expiresTime: expiresTime path: pathString domain: domainString secure: secureBoolean
-
set a cookie in the Response
-
setCookieName: nameString value: valueString path: pathString
-
set a cookie in the Response
testing
-
isGetRequest
-
-
isHeaderRequest
-
-
isPostRequest
-
user authentication
-
clearPassword
-
-
getUsername
-
-
hashPassword: aPassword
-
-
isUsername: aUsername password: aPassword
-
-
secretWord
-
-
setUsername: aUsername
-
save the username in a cookie
-
setUsername: aUsername password: aPassword
-
save the username/password in cookies
-
userObject
-
-
userObject: anObject
-
|