Class: Network

@proceed/system.Network

Abstraction layer for communication with other machines

user mustn't need to know what kind of communication method is used

Methods

(async) sendData(ip, port, endpoint, method, type, data, additionalHeadersopt)

Send data to another machine

Parameters:
Name Type Attributes Description
ip string

address of the engine the data is to be send to

port number

port of the engine the data is to be send to

endpoint string

endpoint the data is to be send to

method string

REST method that has to be used (e.g 'PUT' or 'POST')

type string

mime-type of the data that is to be send

data object

data that has to be send

additionalHeaders Object <optional>

additional headers to use in the request

Source:

(async) sendRequest(ip, port, endpoint, options, preferNode)

Sends a request to another machine with the given ip and port values

Parameters:
Name Type Description
ip string

ip of the engine the request is to be send to

port number

port of the engine the request is to be send to

endpoint string

endpoint for the request

options object | null

options for the request

preferNode boolean

overwrite to enforce usage of nodes http module

Source: