CXXMicroService
CXXMicroService copied to clipboard
Introduction of HTTP interface
The framework needs the introduction of an HTTP interface
Hello, @ZigRazor, I can try to do it. Could you please provide some additional details? Specifically, I'd like to know whether can we use an open-source library for handling HTTP, or if we need to implement the HTTP interface from scratch. Additionally, could you clarify which type of interface we are required to implement? For example, it could be a REST API, JSON-RPC, or any other specific type
I think we can start from REST-API, then we can add JSON-RPC and so on. I don't love introduce dependecy in this kind of framework, but if you know a "Standard the Facto" open-source library for HTTP, you can introduce it!
I think we can start from REST-API, then we can add JSON-RPC and so on. I don't love introduce dependecy in this kind of framework, but if you know a "Standard the Facto" open-source library for HTTP, you can introduce it!
Alright, my idea is to use the libcurl library for accessing HTTPS and integrate ZeroMQ (zmq) for message passing. Then, we will implement the classes HTTPClient and CurlHandle, which will include the following functionalities:
Initialization and cleanup of the session for working with HTTP. Execution of HTTP requests to retrieve textual data or upload files. Setting and getting various session settings, such as using HTTPS, proxy servers, timeouts, etc. Support for SSL certificates for secure data transmission over HTTPS. Execution of different types of HTTP requests (GET, POST, PUT, DELETE) and processing responses from the server. Logging errors and events using callbacks. With the addition of ZeroMQ, we will be able to use message passing for communication between different components of the system, making it more flexible and scalable. If you have any suggestions or improvements, feel free to write them.
Your idea is perfect! You can go on!