|
| 1 | +# autorequests |
| 2 | + |
| 3 | +Autorequests provides an easy way to create a simple API wrapper from data generated by your browser. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +### Showcase |
| 10 | + |
| 11 | +** the website shown in this example is [imperialb.in](https://imperialb.in) |
| 12 | + |
| 13 | + |
| 14 | +### Example Use Cases |
| 15 | + |
| 16 | +* Creating a foundation for an API wrapper |
| 17 | +* Testing what cookies / headers are required for a server to understand your request |
| 18 | + |
| 19 | +### How to Copy Data |
| 20 | + |
| 21 | +1. Do an action on a website that causes a web request to be sent. |
| 22 | +2. Right-click --> Copy-As --> Node.JS Fetch |
| 23 | + |
| 24 | +## 🖥️ Command Line |
| 25 | + |
| 26 | +```console |
| 27 | +$ autorequests --help |
| 28 | +``` |
| 29 | + |
| 30 | +directory control |
| 31 | + |
| 32 | +```console |
| 33 | + -i, --input Input Directory |
| 34 | + -o, --output Output Directory |
| 35 | +``` |
| 36 | + |
| 37 | +parsing control |
| 38 | + |
| 39 | +``` |
| 40 | + --no-headers Removes all headers from the operation |
| 41 | + --no-cookies Removes all cookies from the operation |
| 42 | +``` |
| 43 | + |
| 44 | +# 🚩 Known Issues |
| 45 | + |
| 46 | +* Method names are parsed from the url, but if the URL doesn't have any paths with a valid method name, an invalid |
| 47 | + method name will be used. |
| 48 | +* Sometimes when copying fetches from the browser, some important headers aren't including, causing the resulting API |
| 49 | + wrapper to fail requests. |
| 50 | + |
| 51 | +# 📅 Planned Features |
| 52 | + |
| 53 | +* converting camelCased method names to snake_case. |
| 54 | +* replace hardcoded values with parameters that have default values. |
| 55 | +* detecting base paths (like /api/v1) and setting that in the class constructor. (maybe). |
| 56 | +* the ability to parse other formats of data from the browser (not just fetches). |
| 57 | + |
| 58 | +# 🐞 Contributing |
| 59 | + |
| 60 | +This project has a lot of room for improvement in optimizing regexps, better OOP, and bug fixes. If you make an issue, |
| 61 | +pr or suggestion, it'll be very appreciated <3. |
0 commit comments