CXXMicroService icon indicating copy to clipboard operation
CXXMicroService copied to clipboard

Introduction of HTTP interface

Open ZigRazor opened this issue 3 years ago • 4 comments

The framework needs the introduction of an HTTP interface

ZigRazor avatar Oct 03 '22 09:10 ZigRazor

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

DavidRomanovizc avatar Jul 26 '23 08:07 DavidRomanovizc

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!

ZigRazor avatar Jul 26 '23 08:07 ZigRazor

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.

DavidRomanovizc avatar Jul 27 '23 11:07 DavidRomanovizc

Your idea is perfect! You can go on!

ZigRazor avatar Jul 27 '23 12:07 ZigRazor