I'm writing an app for my server which has a RESTful API. Thus far, to quickly test features as I add them, I just use curl on the terminal to see if a POST or GET request is working properly. When they work properly, I get an easy to read JSON response. When it doesn't work, I get 2000 lines of HTML produced by Django. It's fairly tedious to have to copy and paste this response into a text file, save it, then open it in a web browser to view what the details of the error are.
There has to be an easier way of doing this. I could probably write a small command line utility which would run curl for me, grep for </html> and respond with the JSON if it's not found, or save the results into a tmp file and open it in a browser if it does find that... in fact, that's probably easier done then said.
Still looking to hear what solutions other people have.
There has to be an easier way of doing this. I could probably write a small command line utility which would run curl for me, grep for </html> and respond with the JSON if it's not found, or save the results into a tmp file and open it in a browser if it does find that... in fact, that's probably easier done then said.
Still looking to hear what solutions other people have.