|
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">endOfRequestHeaderMarker
-
This marks the end of an HTTP request (two consecutive CR-LFs)
authentication
-
> hashPassword:">hashPassword: aPassword
-
-
> secretWord">secretWord
-
a string used in hashing passwords
defaults
-
> defaultContentType">defaultContentType
-
-
> defaultMethod">defaultMethod
-
-
> defaultProtocol">defaultProtocol
-
-
> defaultUrl">defaultUrl
-
initialize-release
-
> initialize">initialize
-
(comment from inherited method)
called only once - initialize signals
instance creation
-
> readFromStream:">readFromStream: aStream
-
accessing
-
> contentLength">contentLength
-
-
> contentType">contentType
-
get rid of charset field
-
> cookies">cookies
-
answer a dictionary with the cookies in the request
-
> endOfRequestHeaderMarker">endOfRequestHeaderMarker
-
-
> getFields">getFields
-
retrieve fields encoded in the URL: http://aha/ha?a=1&b=2
-
> header">header
-
-
> header:">header: aDict
-
-
> host">host
-
-
> localAddress">localAddress
-
Answer the address of the request originator
-
> localPort">localPort
-
Answer the address of the request originator
-
> method">method
-
-
> method:">method: aString
-
-
> multiValueFormFields">multiValueFormFields
-
-
> multiValueFormFieldsDisable">multiValueFormFieldsDisable
-
disable use of multi-value form fields
-
> multiValueFormFieldsEnable">multiValueFormFieldsEnable
-
enable use of multi-value form fields
-
> postFields">postFields
-
Answer the multipart fields for a post request (if in fact this is a
POST request
-
> protocol">protocol
-
-
> queryString">queryString
-
-
> queryString:">queryString: aString
-
-
> rawPostFields">rawPostFields
-
save the POST form fields as is, for future processing, see #postFields
-
> rawUrl">rawUrl
-
-
> referer">referer
-
-
> remoteAddress">remoteAddress
-
-
> remoteAddress:">remoteAddress: aRemoteAddress
-
-
> stream">stream
-
-
> stream:">stream: something
-
-
> stxHttpRequest">stxHttpRequest
-
-
> stxHttpRequest:">stxHttpRequest: something
-
-
> timestamp">timestamp
-
-
> timestamp:">timestamp: aTimestamp
-
-
> url">url
-
-
> url:">url: aUrl
-
-
> user">user
-
currently, only basic authentication is supported
connection mgt
-
> isPersistentConnection">isPersistentConnection
-
defaults
-
> defaultContentType">defaultContentType
-
-
> defaultMethod">defaultMethod
-
-
> defaultProtocol">defaultProtocol
-
-
> defaultUrl">defaultUrl
-
initialize-release
-
> destroy">destroy
-
-
> initRemoteAddress">initRemoteAddress
-
-
> initStatusString:">initStatusString: aString
-
self protocol: statusLine third
-
> initUrl:">initUrl: aString
-
-
> initializeFromStream:">initializeFromStream: aStream
-
[(self readRequestHeaderFrom: stream)
-
> readRequestHeaderFrom:">readRequestHeaderFrom: aStream
-
force reading/parsing post fields
multipart forms
-
> multipartBoundary">multipartBoundary
-
boundary specification in the HTTP header looks like:
Content-Type: multipart/form-data; boundary=BOUNDARY
-
> multipartFormFieldsDo:">multipartFormFieldsDo: aBlock
-
USAGE:
request multipartFormFieldsDo: [:chunk |
chunk saveToStream: aStream].
-
> nextChunkHeader">nextChunkHeader
-
Read the next multipart data chunk's header
printing
-
> printOn:">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:">writeOn: aStream
-
this can be used to form a client-side request and send it over network
private
-
> parseCookies:">parseCookies: aString
-
PRIVATE: Parse a string in the format:
Cookie: NAME1=OPAQUE_STRING1; NAME2=OPAQUE_STRING2 ...
response
-
> badRequest">badRequest
-
-
> redirectTo:">redirectTo: aUrl
-
-
> unauthorizedFor:">unauthorizedFor: realm
-
response cookies
-
> responseCookies">responseCookies
-
cookies that need to be set
-
> setCookieName:value:expiresDate:expiresTime:path:domain:secure:">setCookieName: nameString value: valueString expiresDate: expiresDate expiresTime: expiresTime path: pathString domain: domainString secure: secureBoolean
-
set a cookie in the Response
-
> setCookieName:value:path:">setCookieName: nameString value: valueString path: pathString
-
set a cookie in the Response
testing
-
> isGetRequest">isGetRequest
-
-
> isHeaderRequest">isHeaderRequest
-
-
> isPostRequest">isPostRequest
-
user authentication
-
> clearPassword">clearPassword
-
-
> getUsername">getUsername
-
-
> hashPassword:">hashPassword: aPassword
-
-
> isUsername:password:">isUsername: aUsername password: aPassword
-
-
> secretWord">secretWord
-
-
> setUsername:">setUsername: aUsername
-
save the username in a cookie
-
> setUsername:password:">setUsername: aUsername password: aPassword
-
save the username/password in cookies
-
> userObject">userObject
-
-
> userObject:">userObject: anObject
-
|