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.39 date: 2024/03/05 11:23:45
user: cg
file: HTTPResponseHeader.st directory: goodies/webServer
module: stx stc-classLibrary: webServer

Description:


collects the fields of an HTTP response header

copyright

COPYRIGHT (c) 2003 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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

** This is an obsolete interface - do not use it (it may vanish in future versions) **


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.
No LONGER:
Since we currently use 1-byte strings, our default character set is ISO8859-1.
This has changed to default (which is UTF-8 nowadays)

Usage example(s):

contentType := 'text/html; charset=ISO-8859-1'.

Usage example(s):

contentType := 'text/html; charset=UTF-8'.

o  contentType: aString
set the contentType field

o  contentType: aContentTypeArg contentLength: contentLengthArg expirationTime: expirationTimestampArg

o  expectedAuthRealm: something

o  expirationTime

o  expirationTime: expirationTimestamp
the responses expirationTimestamp.
Obsolete, only for old HHTP/1.0 caches, which are long gone.
Use #maxAge:

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

o  httpVersion

o  httpVersion: something

o  isWebSocketResponseHeader: aBoolean

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

o  setNoCache
Tell the client and possible caches to not cache the response

actions
o  addLineToHeader: aString

o  redirectTo: targetUrl
setup for a redirect response

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

o  hasFilename

o  isBinaryContent

o  isWebSocketResponseHeader

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 21 Nov 2024 13:14:52 GMT