eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPInterface::HTTPResponse':

Home

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

Class: HTTPResponse (private in HTTPInterface

This class is only visible from within HTTPInterface.

Inheritance:

   Object
   |
   +--HTTPInterface::HTTPResponse

Package:
stx:goodies/communication
Category:
Net-Communication-HTTP-Client
Owner:
HTTPInterface

Class protocol:

instance creation
o  error: errCode
create a synthetic error response.
Done for errors happening here (i.e. not generated by a contacted server);
for example: unknown host, etc.

o  error: errCode responseText: textOrNil
create a synthetic error response.
Done for errors happening here (i.e. not generated by a contacted server);
for example: unknown host, etc.


Instance protocol:

accessing
o  contentType

o  contentType: something

o  data
return the data converted to a string and decoded by the encoding.
If you need the undecoded bytes, please use #rawData
usage example(s):
^ data

o  data: something

o  dataFile

o  dataFile: something

o  dataFromFileOrData
returns the data either from the data file (which is used if too big) or data directly

o  dataStream
in preparation for a future stream interface (i.e. not loading the data into memory
and returning it, but instead return a stream directly reading from the socket),
use this interface.
However, it is currently not yet avoiding big garbage data in memory.

o  encoding

o  encoding: something

o  headerInfo

o  headerInfo: something

o  headerInfoAt: aKeyString
get the header info for aKeyString (alway lower case)

o  mimeType

o  mimeType: something

o  mimeType: mimeTypeArg encoding: encodingArg data: dataArg
soon obsolete

o  mimeType: mimeTypeArg encoding: encodingArg rawData: dataArg

o  rawData
return the data as bytes, as they were receiver (no decoding by character set, etc)

o  rawData: aByteArray

o  rawHeader

o  rawHeader: something

o  rawHeader: rawHeaderString infoHeader: parsedheader data: dataBytes

o  response

o  response: something

o  responseCode

o  responseCode: anInteger
anInteger >= 500 ifTrue:[self breakPoint:#cg].

o  responseText
answer the text returned with the response, or the empty string

o  responseText: something

o  suppressUnicode

o  suppressUnicode: aBoolean
set this to true to return only single-byte strings as data

o  url

o  url: something

inspecting
o  inspectorExtraAttributes

parsing
o  setupFromRawHeader: rawHeaderArg

printing
o  printOn: aStream
(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.

queries
o  date

o  expires

o  isErrorResponse
return true, if this is an error-response

o  isFileErrorResponse
return true, if this is a file-error-response

o  isMovedResponse

o  location



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Mon, 04 Aug 2025 11:45:47 GMT