Send command via HTTP post to receiver.
196263
def send_post_command(self, command, body):
        """"""
        # Send commands via HTTP post
        res = requests.post("http://{host}:{port}{command}".format(
            host=self._host, port=self._receiver_port, command=command),
                            data=body, timeout=self.timeout)
        if res.status_code == 200:
            return res.text
        else:
            _LOGGER.error((
                "Host %s returned HTTP status code %s to POST command at "
                "end point %s"), self._host, res.status_code, command)
            return False
973290
def _sendCommand(self, command):
        

        if(self.process is not None):
            try:
                if logger.isEnabledFor(logging.DEBUG):
                    logger.debug("Command: {}".format(command).strip())
                self.process.stdin.write(command.encode('utf-8', 'replace'))
                self.process.stdin.flush()
            except:
                msg = "Error when sending: {}"
                if logger.isEnabledFor(logging.ERROR):
                    logger.error(msg.format(command).strip(), exc_info=True)
1282691
def _simple_command(self, command, arg=None, **kwargs):
    """"""
    self._protocol.send_command(command, arg)
    return self._protocol.handle_simple_responses(**kwargs)
895447
def send(self, command):
        
        # The POLL command requests data from the last-seen fixes on all active GPS devices.
        # Devices must previously have been activated by ?WATCH to be pollable.
        try:
            self.streamSock.send(bytes(command, encoding='utf-8'))
        except TypeError:
            self.streamSock.send(command)  # 2.7 chokes on 'bytes' and 'encoding='
        except (OSError, IOError) as error:  # MOE, LEAVE THIS ALONE!...for now.
            sys.stderr.write('\nGPS3 send command fail with {}\n'.format(error))
1119157
def __send_command(self, command, command_string=b'', response_size=8):
        
        if command not in [const.CMD_CONNECT, const.CMD_AUTH] and not self.is_connect:
            raise ZKErrorConnection("instance are not connected.")

        buf = self.__create_header(command, command_string, self.__session_id, self.__reply_id)
        try:
            if self.tcp:
                top = self.__create_tcp_top(buf)
                self.__sock.send(top)
                self.__tcp_data_recv = self.__sock.recv(response_size + 8)
                self.__tcp_length = self.__test_tcp_top(self.__tcp_data_recv)
                if self.__tcp_length == 0:
                    raise ZKNetworkError("TCP packet invalid")
                self.__header = unpack('<4H', self.__tcp_data_recv[8:16])
                self.__data_recv = self.__tcp_data_recv[8:]
            else:
                self.__sock.sendto(buf, self.__address)
                self.__data_recv = self.__sock.recv(response_size)
                self.__header = unpack('<4H', self.__data_recv[:8])
        except Exception as e:
            raise ZKNetworkError(str(e))

        self.__response = self.__header[0]
        self.__reply_id = self.__header[3]
        self.__data = self.__data_recv[8:]
        if self.__response in [const.CMD_ACK_OK, const.CMD_PREPARE_DATA, const.CMD_DATA]:
            return {
                'status': True,
                'code': self.__response
            }
        return {
            'status': False,
            'code': self.__response
        }
402762
function sendMessage(command, opt_value, opt_transfer) {
    // TODO(benvanik): attempt to use webkitPostMessage
    originalPostMessage.call(goog.global, {
      '__wtf_worker_msg__': true,
      'command': command,
      'value': opt_value || null
    }, []);
  }
772897
def send(self, cmd):
        
        self._bridge.send(cmd, wait=self.wait, reps=self.reps)
604883
def _send_command(self, command):
        
        try:
            if isinstance(command, list):
                for cmd in command:
                    output = self.device.send_command(cmd)
                    if "% Invalid" not in output:
                        break
            else:
                output = self.device.send_command(command)
            return self._send_command_postprocess(output)
        except (socket.error, EOFError) as e:
            raise ConnectionClosedException(str(e))
871048
def _exec_appcommand_post(self, command, param):
        
        xml = """<?xml version="1.0" encoding="UTF-8"?>
        <harman>
            <avr>
                <common>
                    <control>
                        <name>""" + command + """</name>
                        <zone>""" + self._zone + """</zone>
                        <para>""" + param + """</para>
                    </control>
                </common>
            </avr>
        </harman>"""
        command = """POST AVR HTTP/1.1\r\nHost: :""" + str(self._port) \
                  + """\r\nUser-Agent: Harman Kardon AVR Remote """\
                  + """Controller /2.0""" \
                  + """\r\nContent-Length: """ + str(xml.__len__()) \
                  + """\r\n\r\n""" + xml

        if self._socket is None:
            self._socket = self._get_new_socket()
        if self._socket is None:
            _LOGGER.warning("Cannot connect to AVR")
            return
        try:
            resp = self._socket.sendto(command.encode(),
                                       (self._host, self._port))
            if resp == 0:
                self._socket.close()
                self._socket = None
                _LOGGER.warning("Send fail, disconnecting from AVR")
        except (BrokenPipeError, ConnectionError) as connect_error:
            _LOGGER.warning("Connection error, retrying. %s", connect_error)
            self._socket = None
            self._socket = self._get_new_socket()
            if self._socket is not None:
                # retrying after broken pipe error
                self._socket.sendto(command.encode(), (self._host, self._port))
1229108
def send_post(config, urlpath, post_data):
    '''
    
    '''
    server = config.get("Server", "url")
    logger.debug("Sending executor payload to " + server)
    post_data = urlencode(post_data)
    post_data = post_data.encode("utf-8", errors="ignore")
    url = server + urlpath
    try:
        urlopen(url, post_data)
    except Exception as e:
        logger.error('Error while sending data to server: ' + str(e))
1277865
function _send(cmd, callback) {
      cmd_callback = callback;
      if(connected) {
        client.write(cmd + '\n');
      } else {
        connect();
      }
    }
59305
def send_command(self, obj, command, *arguments):
        
        self._perform_command('{}/{}'.format(self.session_url, obj.ref), command, OperReturnType.no_output, *arguments)
260204
def send(self, cmd, *payload):
        

        # If it's closed, raise an error up front
        if not self._sock:
            raise ConnectionClosed("Connection closed")

        # Construct the outgoing message
        msg = json.dumps(dict(cmd=cmd, payload=payload)) + '\n'

        # Send it
        try:
            self._sock.sendall(msg)
        except socket.error:
            # We'll need to re-raise
            e_type, e_value, e_tb = sys.exc_info()

            # Make sure the socket is closed
            self.close()

            # Re-raise
            raise e_type, e_value, e_tb
1179987
def send_command(self, command, *arguments):
        
        self.api.send_command(self, command, *arguments)
701356
def send_command_return(self, command, *arguments):
        
        return self.api.send_command_return(self, command, *arguments)
193731
function send_command(RequiresSession, Command, Parameters, callback) {

			// Check for requirements.
			if (RequiresSession && !Member.session_id) {
				if (callback) { callback(Error('No existing session found. Login required.'), null); }
				return;
			}

			// Start a new transaction.
			var transaction_id = 'TX-' + unique_id();

			// Set up the one time response handler.
			Socket.once(Command + '.' + transaction_id,
				function(Err, Response) {
					if (callback) { callback(Err, Response); }
					return;
				});

			// Clone the command parameters and mark it with our control structure.
			var parameters = JSON.parse(JSON.stringify(Parameters));
			parameters.control = {
				transaction_id: transaction_id,
				session_id: Member.session_id
			};

			// Invoke the function.
			Socket.emit(Command, parameters);

			return;
		}
70823
def send_command(self, obj, command, *arguments):
        
        index_command = obj._build_index_command(command, *arguments)
        self.chassis_list[obj.chassis].sendQueryVerify(index_command)