Discussing the article: "Implementing Practical Modules from Other Languages in MQL5 (Part 02): Building the REQUESTS Library, Inspired by Python"

 

Check out the new article: Implementing Practical Modules from Other Languages in MQL5 (Part 02): Building the REQUESTS Library, Inspired by Python.

In this article, we implement a module similar to requests offered in Python to make it easier to send and receive web requests in MetaTrader 5 using MQL5.

An ability to send HTTP requests to the web directly from MetaTrader 5 is one of the best things that's ever happened to the MQL5 programming language. With this ability, traders can communicate with their external websites, servers, trading apps, etc.

This makes us capable of doing almost everything inside the trading platform, like getting data from external sources, sending trading notifications to our peers, and much more.

This ability has been made possible by the function WebRequest available in MQL5, which enables us to perform any HTTP action such as:

  • Sending "POST" requests for sending information to external servers.
  • Getting information from the web using the famous "GET" request.
  • Sending PATCH requests to the web for modifying information from the server's database.
  • Sending PUT requests to the web for updating values present in the server's database.

To name a few HTTP actions.

However, this single function can be overwhelming sometimes, and it's not user-friendly.

Author: Omega J Msigwa