Constructor
new ResQ4S(q4sVersion, statusCode, reasonPhrase, headers, body)
Constructor for the ReqQ4S class. Does not validate input data coherence.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
q4sVersion |
string | The string containing the Q4S version. | ||||||
statusCode |
number | The status code of the response | ||||||
reasonPhrase |
string | The reason of the response | ||||||
headers |
Object | Object containing all the headers.
Properties
|
||||||
body |
string | The body of the request. Normally a sdp message. |
- Source:
Members
body :String
The body of the response.
Type:
- String
- Source:
headers :Object
Object containing the headers. Each property name os the name of the
header. Its value is the field.
Type:
- Object
- Source:
q4sVersion :String
The Q4S protocol version
Type:
- String
- Source:
reasonPhrase :String
String containing a human redable reasoning of the error code.
Type:
- String
- Source:
statusCode :Number
The status code
Type:
- Number
- Source:
Methods
(static) fromString(str) → {Object}
Factory method to build a new ResQ4S from an string. Validates the the
string is correct.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to parse to the ReqQ4S. |
- Source:
Returns:
On sucess an object of the class ResQ4S, on error
returns an error.
- Type
- Object
(static) genRes(statusCode, headers, body) → {ResQ4SQ}
Factory method to build a new ResQ4S abstracting part of the details.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
statusCode |
number | The status code of the response | ||||||
headers |
Object | Object containing all the headers.
Properties
|
||||||
body |
string | The body of the request. Normally a sdp message. returns an error. |
- Source:
Returns:
- Type
- ResQ4SQ
toString() → {string}
Form the message format of this Response and send it over the network.
- Source:
Returns:
- String format of this Request.
- Type
- string
validate() → {boolean}
Check that the data is correct and follows the required rules. This
method checks the response, so there wont be body validation.
- Source:
Returns:
True is the data is correct. False otherwise.
- Type
- boolean