I personally use Postman for this. It costs 10$ and you can write Tests with it, run Automatic tests. You can export the tests as JSON. Important thing to note is that this is only a Chrome extension.
With a command line tool called Newman from the same company you can run these tests from a console. In the command line you can run the JSON exports.