> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTPClient

## HTTPClient

Inherits from: `object`

Direct HTTP client for robot communication.

Provides simple REST API access to robot endpoints. Best suited for
web applications, scripts, and IoT devices requiring lightweight
HTTP-based robot control.

### **init**

```python theme={null}
HTTPClient.__init__(robot_ip: str, port: int = 4774, enable_heartbeat: bool = True, heartbeat_interval: float = 3.0) -> None
```

Initialize HTTP client.

<ResponseField name="Arguments">
  <ParamField query="robot_ip (str)" type="str" required>
    IP address of the robot
  </ParamField>

  <ParamField query="port (int)" type="int">
    Port number (default 4774)
  </ParamField>

  <ParamField query="enable_heartbeat (bool)" type="bool">
    Enable automatic heartbeat monitoring for safety
  </ParamField>

  <ParamField query="heartbeat_interval (float)" type="float">
    Heartbeat interval in seconds (default 3.0)
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

<ResponseField name="Raises">
  <ParamField query="ImportError" type="">
    If requests library is not installed
  </ParamField>
</ResponseField>

### is\_connected

```python theme={null}
HTTPClient.is_connected() -> bool
```

Check if HTTP client can connect.

<ResponseField name="Returns">
  <ResponseField name="bool" type="bool">
    True if client can successfully connect to the robot
  </ResponseField>
</ResponseField>

### disconnect

```python theme={null}
HTTPClient.disconnect() -> None
```

Disconnect HTTP client and stop heartbeat monitoring.

Stops the heartbeat monitoring thread and cleans up resources.

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>
