Native REST client for Haiku (WIP)

I’ve been playing a bit with the netservices2 HTTP kit, and inspired by HttpShout from @nielx and Postman, I’ve started working on a native REST API client:

This is very much work in progress, there are lots of missing features and bugs, and I haven’t done any extensive testing yet.

You can build a request (method, URL, headers, form params or raw body), authenticate with Basic/Bearer/API key, see a live preview of the request before sending, and inspect the response (status, headers, body). Request history is kept and persists between sessions.

Any feedback, suggestions or bug reports are welcome.

23 Likes

Awesome work @johan!

1 Like

I’ve just pushed some changes to Github, most notable is the addition of collections. Queries can now be saved (directly or from the history) and organized for later use.

Up next I’m working on support for custom headers (very important) and import/export of collections.

8 Likes

Hi!

I wanted to compile from source but I have an error:

~/dev/NetWorker> make
g++ -c src/CollectionExporter.cpp -iquote./ -iquote./ -iquoteobjects.x86_64-cc13-release/ -iquotesrc/ -iquotesrc/layout/ -isystem/boot/system/develop/headers/private/interface -isystem/boot/system/develop/headers/be -isystem/boot/system/develop/headers/cpp -isystem/boot/system/develop/headers/private/netservices2 -Ithird_party -O3 -o “objects.x86_64-cc13-release/CollectionExporter.o”
src/CollectionExporter.cpp:11:10: fatal error: nlohmann/json.hpp: No such file or directory
11 | #include <nlohmann/json.hpp>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/boot/system/develop/etc/makefile-engine:298: objects.x86_64-cc13-release/CollectionExporter.o] Error 1

Any suggestions? :slightly_smiling_face:

You need to install dependencies

Search on HaikuDepot for them.

Here nhlonmann

1 Like

@phoudoin thank you very much! :slight_smile:

Found, installed, compiled successfully! :+1:

Glad you solved it @walaki . The nlomann/json.hpp file is actually included in the source code, but I had an error in the Makefile that I hadn’t noticed, since I also had the library installed from HaikuDepot.

I’ve updated the Makefile and it should compile now, even without installing anything from HaikuDepot.

2 Likes

@johan yes, I saw the file in the sources and it was confusing seeing that error.

Thank you for the update! :+1:

1 Like