Skip to content

Useful script to convert HTTP Messages to requests functions

License

Notifications You must be signed in to change notification settings

freshSauce/HTTPToRequests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues GNU GPLv3 License Telegram

HTTPToRequests

Tired of translating HTTP Messages to Python requests by hand or doing a curl->requests translation everytime? Say no more! Here is HTTPToRequests, a tool that let you translate HTTP messages to python code ready to use!

Features

  • CLI/Module use
  • Support for burpsuite
  • Easy to use
  • Support for OOP styled code or only functions.

Usage/Examples

Usage within code:

from httpconverter import HTTPConverter 

file = "./examples/example.xml"

converter = HTTPConverter(file)
converter.extract() # Optional flags:
                    # use_oop - Write OOP styled code or just the functions. False by default
                    # force_dicts - Forces arguments to dictionary (i.e. form-data, params, etc.). False by default

CLI usage:

$ python -m httpconverter.cli --file ./examples/example.xml --output example.py
$ File converted and saved to example.py

Installation

You can install the script to access it anywhere.

  python setup.py install
  httpconverter --file FILE.xml --output OUTPUT.py

Running Tests

To run tests, run the following command

  pytest .\tests\

License

Distributed under the GNU GPLv3 License. See LICENSE for more information.

Contributing

Want to contribute to the project? Great! Please follow the next steps in order to submit any feature or bug-fix :) You can also send me your ideas to my Telegram, any submit is greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request