Object built-in object

Object HttpRepeater

http request forwarding processor

http used to forward http requests to the back-end server. The usage is as follows:

1 2
var http = require('http'); var hr = new http.Repeater('http://10.0.0.100:8080/test');

Inheritance

Constructor

HttpRepeater

HttpRepeater constructor to create a new HttpRepeater object

1
new HttpRepeater(String url);

Call parameters:

  • url : String, specify a back-end server url

HttpRepeater constructor to create a new HttpRepeater object

1
new HttpRepeater(Array urls);

Call parameters:

  • urls : Array, specify a set of back-end server url

Member attributes

urls

NArray, query the current backend server url list

1
readonly NArray HttpRepeater.urls;

client

HttpClient , the HttpClient object used internally by the request forwarding processor

1
readonly HttpClient HttpRepeater.client;

Member function

load

Load a new set of backend url

1
HttpRepeater.load(Array urls);

Call parameters:

  • urls : Array, specify a set of back-end server url

invoke

Process a message or object

1
Handler HttpRepeater.invoke(object v) async;

Call parameters:

  • v : object , specify the message or object to be processed

Return result:

  • Handler , return to the next processor

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String HttpRepeater.toString();

Return result:

  • String , returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value HttpRepeater.toJSON(String key = "");

Call parameters:

  • key : String, unused

Return result:

  • Value , returns a value containing JSON serializable