Skip to content

OscarNgombo/xmljsonconverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XML-JSON Converter

This project is a C++ application that provides a web server for converting data between XML and JSON formats.

Features

  • Converts XML to JSON.
  • Converts JSON to XML.
  • Exposes a simple HTTP API for conversions.

Dependencies

Build

  1. Clone the repository:

    git clone <repository-url>
    cd xmljsonconverter
  2. Create a build directory:

    mkdir build
    cd build
  3. Run CMake and build the project:

    cmake ..
    make

Usage

  1. Run the server:

    ./xmljsonconverter

    The server will start on port 8080.

  2. 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
    • 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

Comments From me

  • Enjoy your coding if you need any assistance or want to contribute don't hesitate to reachout or creating a Fork! Happy coding! 😊

About

Learning basic handling of json and xml files and creation of webservices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors