Skip to content

A very barebones, lightweight and with minimal dependencies C++ program to do HTTP requests

License

Notifications You must be signed in to change notification settings

gfickel/postgirl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgirl

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.

postgirl

Main Development Ideas

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

Future Features

  • A JSON input field that says if it is a valid JSON on the fly
  • Support to POST
  • Support to DELETE, PUT, PATCH
  • Save and show the user history
  • Support to multipart/form-data
  • File selector
  • A search function
  • Multiple collections
  • Request templates

Future Code Changes

  • Substitute the stl vector for a modified ImGui::Vector implementation
  • Substitute 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 :)

Used libs

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).

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 :(.

Build

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE ../
make

The binary will be on postgirl/bin folder.

About

A very barebones, lightweight and with minimal dependencies C++ program to do HTTP requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published