Postgirl is supposed to be a bloat-free, small and somewhat limited program to do HTTP requests. The idea is to be a simple yet reliable tool to do some quick tests, but being very good at it. It still has some rough edges, but you can already do the most common requests (GET, POST, PATCH, PUT and DELETE).
This project came from my insatisfaction with Postman lately. The native app takes several seconds to boot, sometimes crashes and if you let it open for a long time it may consume an insane amount of RAM (it topped at around 1GB on my Desktop once). Therefore Postgirl, a much simpler alternative.
This is definitely a toy project of mine. I do indeed pretend to use it on a daily basis, therefore it must be somewhat functional and easy to use, however it is being a playground for tests. Those are some guidelines that I'm trying to follow:
- Minimal external dependencies. Having to install libcurl appart is really bugging me...
- Minimal STL usage: STL is great but it also comes with some costs that are usually ignored such as (sometimes greatly) increased compilation time and horrible stack traces to follow on debug. For example, I added both thread and vector and the main.cpp compilation went from 600ms to 1000ms :( . Looking to remove those on the near future.
- NEVER loose GUI responsiveness
- Cross plataform code: everything here should work on Mac, Windows and Linux.
- Simple code without excessive abstractions
A JSON input field that says if it is a valid JSON on the flySupport to POSTSupport to DELETE, PUT, PATCHSave and show the user historySupport to multipart/form-dataFile selectorA search function- Multiple collections
- Request templates
Substitute the stl vector for a modified ImGui::Vector implementationSubstitute the stdl string for a lighteight version closer to char*- Load collection/history values from disk on the fly to avoid loading it all to RAM, perhaps using a cache of some sort.
- Find a small multi platform threading library (perhaps extend stb.h to use Posix on Linux/Mac). Then we will get rid of stl thread, hopefully gain some compilation time and drop the C++11 requirement :)
I'm using the excelent Dear ImGui for GUI, created using the Immediate Mode Gui architecture. It is a very easy intuitive way to create GUIs, so I suggest that you take a look if you don't know about it.I've also decided to use OpenGL3 as the backend since it should be easy to link and compile in any platform, but I really don't know much about the other alternatives.
For the HTTP requests I'm using libcurl, but it was not so easy to incorporate it's code in here so you should install it on your system (check Dependencies).
For Linux (Ubuntu):
apt-get install libglfw3 libglfw3-dev libcurl4-openssl-dev
On Mac:
brew install glfw3
brew install curl --with-openssl
All of those dependencies are available on Windows but I don't have the time to check how to install them, unfortunately :(.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE ../
make
The binary will be on postgirl/bin folder.