|
Class: HTTPResponse (private in HTTPInterface
This class is only visible from within
HTTPInterface.
Object
|
+--HTTPInterface::HTTPResponse
|
+--HTTPInterface::WebSocketResponse
- Package:
- stx:goodies/communication
- Category:
- Net-Communication-HTTP-Client
- Owner:
- HTTPInterface
- Author:
- Stefan Vogel
a response received from an HTTPInterface request.
[instance variables:]
[class variables:]
instance creation
-
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.
-
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.
Compatibility-Squeak
-
contents
-
for squeak ZnRequest compatibility
-
headers
-
for squeak ZnRequest compatibility
-
status
-
for squeak ZnRequest compatibility
accessing
-
contentType
-
-
contentType: aString
-
Modified (format): / 21-05-2021 / 12:26:29 / cg
-
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: something
-
-
dataFile
-
-
dataFile: something
-
-
dataFromFileOrData
-
returns the data either from the data file (which is used if too big) or data directly
-
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.
-
encoding
-
-
encoding: aString
-
Modified (format): / 21-05-2021 / 12:26:41 / cg
-
headerInfo
-
-
headerInfo: something
-
-
headerInfoAt: aKeyString
-
get the header info for aKeyString (alway lower case)
-
mimeType
-
-
mimeType: aMimeTypeString
-
set the mimetype of the response
-
mimeType: mimeTypeArg encoding: encodingArg data: dataArg
-
marked as obsolete by Stefan Vogel at 28-Sep-2022
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
mimeType: mimeTypeArg encoding: encodingArg rawData: dataArg
-
-
peerAddress
-
-
peerAddress: something
-
-
rawData
-
return the data as bytes, as they were received (no decoding by character set, etc)
-
rawData: aByteArray
-
-
rawHeader
-
-
rawHeader: aCollectionOfLines
-
-
rawHeader: rawHeaderString infoHeader: parsedheader data: dataBytes
-
marked as obsolete by Stefan Vogel at 28-Sep-2022
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
response
-
-
response: something
-
-
responseCode
-
-
responseCode: anInteger
-
anInteger >= 500 ifTrue:[self breakPoint:#cg].
-
responseText
-
answer the text returned with the response, or the empty string
-
responseText: aString
-
-
socketAddress
-
-
socketAddress: something
-
-
suppressUnicode
-
-
suppressUnicode: aBoolean
-
set this to true to return only single-byte strings as data
-
url
-
-
url: aString
-
Modified (format): / 21-05-2021 / 12:27:02 / cg
inspecting
-
inspectorExtraAttributes
-
(comment from inherited method)
extra (pseudo instvar) entries to be shown in an inspector.
Answers a dictionary of aString -> aBlock.
aString is name of extra attribute and MUST start with minus ($-).
aBlock returns the object representing extra attribute
parsing
-
setupFromRawHeader: rawHeaderArg
-
printing
-
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
-
date
-
-
expires
-
-
isAuthenticationRequiredResponse
-
-
isErrorResponse
-
return true, if this is an error-response
-
isFileErrorResponse
-
return true, if this is a file-error-response
-
isForbiddenResponse
-
-
isMovedResponse
-
-
isNotFoundResponse
-
-
isOKResponse
-
return true, if this is a 200-response
-
location
-
|