This project is a C++ application that provides a web server for converting data between XML and JSON formats.
- Converts XML to JSON.
- Converts JSON to XML.
- Exposes a simple HTTP API for conversions.
-
Clone the repository:
git clone <repository-url> cd xmljsonconverter
-
Create a build directory:
mkdir build cd build -
Run CMake and build the project:
cmake .. make
-
Run the server:
./xmljsonconverter
The server will start on port 8080.
-
Use the API endpoints:
-
XML to JSON:
- Endpoint:
/api/convert - Method:
POST - Body: Raw XML data.
- Example:
curl -X POST -H "Content-Type: application/xml" --data "<root><key>value</key></root>" http://localhost:8080/api/convert
- Endpoint:
-
JSON to XML:
- Endpoint:
/api/convert - Method:
POST - Body: JSON data.
- Example:
curl -X POST -H "Content-Type: application/json" --data '{"root":{"key":"value"}}' http://localhost:8080/api/convert
- Endpoint:
-
- Enjoy your coding if you need any assistance or want to contribute don't hesitate to reachout or creating a Fork! Happy coding! 😊