|
Class: HTTPResponse
Object
|
+--HTTPResponse
|
+--FCGIResponse
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-HTTP-Server
- Version:
- rev:
1.109
date: 2019/07/13 12:22:17
- user: cg
- file: HTTPResponse.st directory: goodies/webServer
- module: stx stc-classLibrary: webServer
- Author:
- Christian Penk
represents a response to an HTTP request as constructed (filled in)
by HTTP-Services.
[instance variables:]
header collects all header data
data a chunk of data to send (if data is available as String or ByteArray)
dataStream a stream collecting (writeStream) or providing (readStream) the replyData
(if data is nil)
request the request for which this is a reply
cookies cokies to set in the client
binary ?
responseAlreadySent flag set by services which send something on their own behalf
(prevent the response from being sent by the server at the end)
http://www.w3.org/Protocols/rfc2616/rfc2616.html
HTTPRequest
HTTPServer
HTTPInterface
constants
-
REPLYCODE_BADREQUEST
-
-
REPLYCODE_FORBIDDEN
-
-
REPLYCODE_GONE
-
-
REPLYCODE_NOTFOUND
-
-
reasonPhrasesDictionary
-
returns a dictionary which maps HTTP-codes to a descriptive message text
instance creation
-
request: aRequest
-
returns an initialized instance for the request
accessing
-
binary
-
get the binary mode flag (data is bytes as opposed to text)
-
binary: aBoolean
-
set/clear binary mode (data is bytes as opposed to text)
-
binaryData: aStreamOrBytes contentType: contentType
-
setup to return the contents of a binary stream
(typically: image data)
-
binaryDataStream: aStreamOrBytes contentType: contentType
-
setup to return the contents of a binary stream
(typically: image data)
-
cookies
-
a collection of cookies (to be filled by the service)
-
data
-
-
data: bytesOrCharacters
-
set the response data en-bloque.
Useful if the data is already available in a service (for example, from a cache)
-
data: bytesOrCharacters contentType: aMimeType
-
set the response data en-bloque and the type.
Useful if the data is already available in a service (for example, from a cache)
-
dataFile: aFilename
-
set the response data to be read from a file.
Useful if the data is big and should not be read in for transmission
-
dataFile: aFilename contentType: aMimeType
-
set the response data to be read from a file and the content type.
Useful if the data is big and should not be read in for transmission
-
dataStream
-
-
dataStream: aStream
-
set the response dataStream.
Useful if the data is to be read from a file and should not be read in for transmission
-
dataStream: aStream contentType: aMimeType
-
set the response dataStream and the content type.
Useful if the data is to be read from a file and should not be read in for transmission
-
expectedAuthRealm
-
-
expectedAuthRealm: aRealm
-
-
header
-
-
header: something
-
-
replyPresenter
-
-
replyPresenter: aDecoratingPresenterOrNil
-
-
replyPresenterDataStream
-
-
request
-
-
request: something
-
-
responseAlreadySent: something
-
actions
-
addCookie: aCookie
-
header access
-
addLineToHeader: aString
-
-
cacheControl
-
-
contentDisposition: aContentDispositionString filename: aFileNameString
-
-
contentLength
-
-
contentLength: aNumber
-
-
contentLocation
-
-
contentLocation: aUrl
-
-
contentType
-
-
contentType: aContentType
-
-
contentType: aContentType contentLength: aNumber expirationTime: aTimeStamp
-
-
expirationTime: aTimeStamp
-
the responses expirationTimestamp; consider to use maxAge:
-
lastModified: aNumber
-
-
location: aUrl
-
-
maxAge: aSecondsIntegerOrTimeDuration
-
how many seconds may this response be cached
-
replyHeader: aCompleteHeaderString
-
some services (e.g. comanche services) generates his own response header
send this header if set from service
-
responseCode
-
-
responseCode: aNumber
-
html reply composition
-
nextPutAll: aString
-
-
nextPutAllEscaped: aString
-
append aString to the collected reply.
The string is processed, by replacing html-special characters by there html-equivalent (such as '>' into <)
-
nextPutLine: aString
-
-
nextPutLineEscaped: aString
-
append aString to the collected reply and append a cr.
The string is processed, by replacing html-special characters by there html-equivalent (such as '>' into <)
-
reply: aString
-
collect part of a reply (i.e. append aString to the reply buffer).
-
reply: aString with: aParameter
-
collect part of a reply (i.e. append aString to the reply buffer);
aString may contain %1 escape which is replaced by aParameter.
-
replyCR
-
-
replyEscaped: aStringOrCharacter
-
collect part of a reply (i.e. append aString to the reply buffer).
Special character (lt, gt) are escaped.
initialization
-
initialize
-
-
resetResponseData
-
start a new collecting response data
(i.e. throw away what has been already collected)
old html reply composition
-
bodyEnd
-
Write </BODY>
-
bodyStart
-
Write <BODY>
-
cr
-
OLD stuff - please use a TreeBuilder
-
formEnd
-
append the standard footer for a form.
-
formFooter
-
Write the standard footer for a form.
-
formResetButton
-
generate a reset button for a form.
-
formSubmitButton
-
OLD stuff - please use a TreeBuilder
-
formSubmitButtonForString: aString
-
OLD stuff - please use a TreeBuilder
-
formSubmitButtonForString: aString name: aName
-
OLD stuff - please use a TreeBuilder
-
formSubmitButtonStringForString: aString name: aName
-
OLD stuff - please use a TreeBuilder
-
htmlEnd
-
OLD stuff - please use a TreeBuilder
-
htmlStart
-
OLD stuff - please use a TreeBuilder
-
imageFor: anImageOrImageFilename
-
generate an IMG tag for a real image (or an image file name)
-
imageFor: anImageOrImageFilename alt: alt
-
an IMG tag for a real image (or an image file name)
-
imageLinkTextFor: anImageOrImageFilename alt: alt
-
an IMG tag for a real image (or an image file name)
-
inputFieldFor: varName label: label initialValue: value
-
an input field - must be within a form
-
inputFieldFor: varName size: size label: label initialValue: value
-
an input field - must be within a form
-
inputFieldFor: varName type: aType size: size label: label initialValue: value
-
an input field - must be within a form
-
inputFieldFor: varName type: aType size: size label: label initialValue: value append: aString
-
an input field - must be within a form.
type: 'password' | 'checkbox' | 'submit' | 'reset' | nil
-
inputFieldStringFor: varName type: aType size: size label: label initialValue: value append: aString
-
an input field - must be within a form.
type: 'password' | 'checkbox' | 'submit' | 'reset' | nil
-
label: labelString id: idString value: anObject
-
Add a table row for the given data to the reply.
-
label: labelString text: aString id: idString rows: rows cols: cols
-
Build a textarea form field.
-
pageFinish
-
finish the page.
-
refreshStringFor: aService selector: aSelector arguments: arguments time: seconds
-
OLD stuff - please use a TreeBuilder
-
refreshStringFor: aService selector: aSelector time: seconds
-
OLD stuff - please use a TreeBuilder
-
stxPoweredByString
-
OLD stuff - please use a TreeBuilder
-
stxPoweredByStringForService: serviceOrNil
-
OLD stuff - please use a TreeBuilder
-
table: aBlock
-
OLD stuff - please use a TreeBuilder
-
table: aBlock attributes: attrString
-
OLD stuff - please use a TreeBuilder
-
tableEnd
-
OLD stuff - please use a TreeBuilder
-
tableFormFooter
-
Close the table and write the standard footer for a form.
-
tableRow: aBlock
-
OLD stuff - please use a TreeBuilder
-
tableRow: aBlock attributes: attrString
-
OLD stuff - please use a TreeBuilder
-
tableRowEnd
-
OLD stuff - please use a TreeBuilder
-
tableRowStart: attrString
-
OLD stuff - please use a TreeBuilder
-
tableStart: attrString
-
OLD stuff - please use a TreeBuilder
-
unformattedCodeTextEnd
-
end some plainText.
-
unformattedCodeTextStart
-
start some plainText.
-
unformattedText: aString
-
add some plainText.
-
unformattedTextEnd
-
end some plainText.
-
unformattedTextStart
-
start some plainText.
old html-reply-composition-stx-obsolete
-
favIconLinkForSTX
-
notice: this requires a file service to run for the /files url
on the ../../goodies/webServer/data/sampleServerDir/files/ folder
-
pageSTXFooter
-
Write the standard page footer.
-
stxBodyEnd
-
attention: some (old) services still use this!
-
stxBodyStart: aString
-
Write a standard stx body with a headline #f6feff
-
stxBodyStart: aString homeLink: aHomeLink
-
Write a standard stx body with a headline #f6feff
-
stxBodyStart: aString homeLink: aHomeLink afterButtons: afterButtonsString
-
Write a standard stx body with a headline #f6feff
-
stxPageFinish
-
finish the page.
-
stxPageParameters
-
attention: some (old) services still use this!
-
stxReply: aString
-
attention: some (old) services still use this!
-
title: aString
-
Write a standard header and set the document title. Also used for logging purposes.
-
title: aString with: someMoreHeaderStuff
-
Write a standard header and set the document title. Also used for logging purposes.
-
titleAndHeader: aString
-
Write a standard header and set the document title. Also used for logging purposes.
queries
-
isErrorResponse
-
-
startReadRequestTime
-
sending
-
send
-
copy over from some stream and send it as a response.
Any already collected replyData is ignored.
Typically used with big files, which we do not want to fill up our memory
(i.e. the document is not loaded as a whole)
usage example(s):
try hard to send it as one block
|
-
sendBinaryData: binaryData type: contentType
-
send some binary data as a response.
Typically used with images and non-text documents
|