content: DynamicHttpResponse
##HttpRequest
This class represents an Http Request
NOTE:* You don't need to use this class! It is the HttpResponse object that will be passed to an HttpRequest callback
@author Simone Cingano (yupswing) Akifox Studio
@repo akifox-asynchttp repository
@licence MIT Licence
Instance Members
isBinary: BoolTells if the content is Binary data (based on contentType)
isText: BoolTells if the content is Text data (based on contentType)
isXml: BoolTells if the content is Xml data (based on contentType)
isJson: BoolTells if the content is Json data (based on contentType)
isImage: BoolTells if the content is Image data (based on contentType)
request: HttpRequestThe request
NOTE: This gives access to the original request (immutable because already sent)
fingerprint: StringFingerprint
NOTE: Same as instance.request.fingerprint
url: URLFinal URL retrived
urlString: StringFinal URL retrived (string format)
DEPRECATED:This is deprecated, use instance.url.toString() instead
headers: HttpHeadersResponse HTTP headers
status: IntResponse HTTP status
NOTE: set to 0 if connection error occurs
Response content (Bytes or String based on the mime-type)
contentRaw: haxe.io.BytesResponse content (Bytes)
contentType: StringResponse content mime-type
NOTE: Always application/octet-stream in FLASH
NOTE: Always text/plain in JAVASCRIPT
contentIsBinary: BoolResponse content binary flag (based on the contentType)
contentLength: IntResponse content length
time: FloatTime elapsed from the request start to the end of the response (in seconds)
filename: StringThe resource filename (default:"unknown")
NOTE: This is a guessed resource filename based on the final retrived url
Example:
URL:http://example.com/download/filename.zip?dl=1
Filename:filename.zip
isOK: BoolA good response
true if the status is >=200 and <400
error: StringtoString(): String| Returns |
|---|
| String |
toXml(): XmlParse the content as XML
| Returns |
|---|
| Xml |
toJson(): DynamicParse the content as Json
| Returns |
|---|
| Dynamic |
toText(): StringGives the content in String format
| Returns |
|---|
| String |
new(request: HttpRequest, time: Float, url: URL, headers: HttpHeaders, status: Int, content: haxe.io.Bytes, ?error: String): VoidClass instance
NOTE: YOU DON'T NEED TO MAKE AN INSTANCE OF THE RESPONSE, IT IS HANDLED INTERNALLY BY THE LIBRARY
The instance is anyway allowed for third party uses of the library
| Name | Type | Default | Description |
|---|---|---|---|
request |
HttpRequest | original request | |
time |
Float | the response time | |
url |
URL | the final url retrived (could be different from the requested URL because of redirects) | |
headers |
HttpHeaders | the response headers | |
status |
Int | the response status (0 if error otherwise HTTP standard response code) | |
content |
haxe.io.Bytes | the response content | |
error |
String | (optional) | the internal error message (optional) |