Constants | ||
Core | ||
Header | ||
Utils | ||
LICENSE | ||
README.md |
Connexus
Connexus is an MQL5 library that offers a simple and effective interface for communicating with web servers using the HTTP protocol. With this library, developers can easily perform HTTP GET, POST, PUT, DELETE, and other requests, as well as send and receive data securely and efficiently.
It makes integrating algorithmic trading applications with external web services easy. With an intuitive interface and comprehensive documentation, Connexus simplifies the process of communicating with web servers, providing MQL5 developers with a powerful tool for remote access to data and web services.
The library's architecture allows for mocking each class, enabling unit testing without relying on HTTP request responses.
🔧 Features
- Send HTTP requests using GET, POST, PUT, DELETE, and other methods.
- Support for JSON format for sending and receiving data.
- Support for secure communication via HTTPS.
- Complete documentation and usage examples.
📖 Installation Guide
- Open the Data folder of your Metatrader5 terminal.
- Navigate to
MQL5/Includes
. - Clone the project into the
/Includes
folder of your Metatrader5 terminal.
git clone https://forge.mql5.io/joaopedrodev/Connexus.git
👨🏻💻 Usage Example
Here is a simple example of how to use the library to make an HTTP GET request to the Binance API
#include <Connexus/Http/HttpClient.mqh>
void OnStart()
{
//--- Creates request/order/response objects
CHttpClient client;
CHttpRequest request;
CHttpResponse response;
//--- Defines the method used and URL
request.Request(HTTP_METHOD_GET,"https://api.binance.com/api/v3/avgPrice?symbol=BTCUSDT");
//--- Check if the request was made successfully
if(client.Send(request,response))
{
//--- Print results
Print("REQUEST | ",request.Method().HttpMethodsDescription()," - ",request.Url().Serialize());
Print("RESPONSE | ",response.Body().Serialize());
}
}
REQUEST | GET - https://api.binance.com:443/api/v3/avgPrice?symbol=BTCUSDT
RESPONSE | {"mins":5,"price":"45358.93311660","closeTime":1707438768533}
📄 Documentation
The complete documentation of the library's functions is available and under construction, but can already be accessed.
🤝 Contributing
Contributions are welcome!
Feel free to open an issue or submit a pull request with improvements or fixes.
📝 License
The Connexus library is released under the MIT license. See LICENSE for details.