# HTTP & MQTT Protocol

In sending data to the internet-based Antares platform, two protocols are provided that can be tried, namely MQTT and HTTP.

### MQTT

The MQTT (Message Queuing Telemetry Transport) protocol is a communication protocol designed for lightweight message exchange between devices connected to a network. MQTT is particularly popular in Internet of Things (IoT) applications, where devices such as sensors, microcontrollers, or other smart devices need to communicate with each other.

### HTTP

The HTTP (Hypertext Transfer Protocol) protocol is also used in the Internet of Things (IoT) for communication between IoT devices and connected servers or services. The HTTP protocol in the context of IoT plays a role in data exchange between IoT devices and the infrastructure that supports them.

### Comparison of MQTT and HTTP Protocols

| **Parameter**       | **MQTT**                                                | **HTTP**                                              |
| ------------------- | ------------------------------------------------------- | ----------------------------------------------------- |
| Power Usage         | Lightweight in resource utilisation                     | Heavier on resource utilisation                       |
| Communication Model | Publish-subscribe                                       | Request-response                                      |
| Overheard Protocol  | Low                                                     | High                                                  |
| Scalability         | Large enough to handle multiple devices and connections | Has a limited number of devices and connections       |
| Connection Control  | Managed by an MQTT server (broker)                      | Connections must be made and maintained by the client |
| Efficiency          | Suitable for IoT protocols                              | Suitable for web applications                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antares.id/en/code-and-library-examples/esp32-wi-fi/http-and-mqtt-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
