Skip to content

Embark on a tech adventure with my C++ curl clone, a journey into the intricacies of sockets, TCP connections, and HTTP protocol. πŸ•΅οΈβ€β™‚οΈ No high-level handholding here - just a pure, low-level exploration crafted in the cool world of C++. πŸ’»πŸš€ Explore the depths of my coding voyage and witness the magic unfold! ✨

License

Notifications You must be signed in to change notification settings

deepakgohil9/curl-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Curl Clone πŸš€

License: MIT

A blazing-fast C++ implementation of a curl clone that supports HTTP GET, POST, DELETE, and PUT requests. It harnesses the power of the CLI11 library for command line argument parsing and dances with the standard UNIX/Linux system libraries for socket wizardry.

✨ Features

  • HTTP GET requests
  • HTTP POST requests
  • HTTP DELETE requests
  • HTTP PUT requests
  • Custom headers
  • Custom data for POST and PUT requests
  • HTTPS support (not implemented yet)

πŸ› οΈ Dependencies

  • CLI11 - The magical wand for command line argument parsing

🚧 Build and Installation

Prerequisites

  • C++ compiler with C++17 support
  • CLI11 library, Already enchanted into the mystical realm of 'includes' directory. 🌌✨

πŸ› οΈ Building from Source

git clone https://github.com/deepakgohil9/curl-clone.git
cd curl-clone
g++ -std=c++11 main.cpp -o ccurl

πŸš€ Usage

./ccurl [OPTIONS] URL

πŸŽ‰ Options

  • -v,--verbose: Dump complete request and response.
  • -X, --request: Specify the request method (GET, POST, PUT, DELETE).
  • -H, --header: Add a custom header to the request.
  • -d, --data: Add data to the request body for POST and PUT requests.
  • URL: The URL to send the request to.

πŸš€ Examples

# Perform a GET request
./ccurl http://eu.httpbin.org/get 

# Perform a POST request with custom headers and data
./ccurl -X POST http://eu.httpbin.org/post \
-d '{"key": "value"}' \
-H "Content-Type: application/json"

# Perform a PUT request with custom headers and data
./ccurl -X PUT http://eu.httpbin.org/put \ 
-d '{"key": "value"}' \
-H "Content-Type: application/json"

# Perform a DELETE request
./ccurl -X DELETE http://eu.httpbin.org/delete 

🀝 Contributing

Contributions are more than welcome! If you find any issues or have suggestions for intergalactic improvements, please open an issue or submit a pull request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™Œ Acknowledgments

  • CLI11 library for providing a user-friendly command line interface.

About

Embark on a tech adventure with my C++ curl clone, a journey into the intricacies of sockets, TCP connections, and HTTP protocol. πŸ•΅οΈβ€β™‚οΈ No high-level handholding here - just a pure, low-level exploration crafted in the cool world of C++. πŸ’»πŸš€ Explore the depths of my coding voyage and witness the magic unfold! ✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages