eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPResponseHeader':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HTTPResponseHeader


Inheritance:

   Object
   |
   +--HTTPResponseHeader
      |
      +--FCGIResponse::ResponseHeader

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Server
Version:
rev: 1.28 date: 2018/10/19 10:35:08
user: cg
file: HTTPResponseHeader.st directory: goodies/webServer
module: stx stc-classLibrary: webServer

Description:


collects the fields of an HTTP response header


Class protocol:

constants
o  reasonPhraseForStatus: statusCode
self reasonPhraseForStatus:401

o  reasonPhrasesDictionary
returns a dictionary which maps HTTP-codes to a descriptive message text

usage example(s):

    self reasonPhrasesDictionary

instance creation
o  httpOKHeaderForResponse: aResponse

o  response: aResponse

o  responseCode: aCode response: aResponse

o  statusCode: aCode response: aResponse


Instance protocol:

accessing
o  additionalHeaderLines
return the collection containing additionalHeaderLines.
Lazily initialized here as an empty collection

o  cacheControl

o  contentDisposition: aContentDispositionString filename: aFileNameString

o  contentLength
contentLength from header as a number, if the header is set by a service as a string
the contentLength field value will be parsed from the header

o  contentLength: something
set the contentLength field

o  contentLocation

o  contentLocation: something

o  contentType
answer the request's content-type.
Since we currently use 1-byte strings, our default character set is ISO8859-1.
This may change to UTF-8 some day

o  contentType: something
set the contentType field

o  contentType: aContentTypeArg contentLength: contentLengthArg expirationTime: expirationTimestampArg

o  expectedAuthRealm: something

o  expirationTime

o  expirationTime: expirationTimestamp
the responses expirationTimestamp; consider to use maxAge:

o  externalHeaderString: aCompleteHeaderString
ATTENTION: we really want a cr-lf here

o  httpVersion

o  httpVersion: something

o  lastModified
the last modified time of a page - typically a file

o  lastModified: lastModifiedTimestamp
the last modified time of a page - typically a file

o  location

o  location: something
Used with a 3xx moved response.

o  maxAge: aSecondsIntegerOrTimeDuration
how many seconds may this response be cached

o  parseFirstLine
parse the first line of a HTML response string

o  response

o  response: something

o  responseCode

o  responseCode: something

actions
o  addLineToHeader: aString
add a crlf to the string if absent

o  redirectTo: targetUrl
setup for a redirect response

queries
o  hasErrorStatusCode
answer true, if this is an error response

o  hasFilename

o  isBinaryContent

sending
o  generateResponseOn: headerStream
must add content-length because external header string does not have one added
(com swiki in some cases)

o  generateResponseStatusOn: headerStream
ATTENTION: we really want a cr-lf here


Private classes:

    CacheControl


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 16 Apr 2021 12:00:38 GMT