Jurl: a modern curl_easy wrapper for Janet #1096
Closed
CosmicToast
started this conversation in
Show and tell
Replies: 2 comments
-
It is a very nice well thought library. I am very happy we finally have a modern and complete curl wrapper. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
-
That's awesome, thanks for publishing the project! I'll definitely put this project to use in my own scripts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Recently, I wrote jurl because I noticed there was no robust HTTP(S) client for Janet that was simultaneously convenient, stable, and comprehensive enough to build additional things (such as, for example, service-specific clients) on top of.
Yesterday, I released version 1.2.0, which marks the stabilization of the final major component of the API: slurp and spit functions.
The native bindings to
libcurl
focus on thecurl_easy
interface because it's required anyway forcurl_multi
, and because Janet is not implicitly threaded anyway. However, as much as possible out of thecurl_easy
API (including non-HTTP parts) are implemented, so that additional clients (e.g FTP, TFTP, SSH) based on libcurl can be built by only building the higher level APIs on top ofjurl/native
.Then, the primary workhorse is the
jurl/request
function, on top of which is implemented a pipeline-style API useful for complex requests or service-specific clients, as well asslurp
andspit
, which are useful for familiar and simple calls for basic usage.The design of the pipeline API is such that you can "prepare" statements for re-use.
For example, imagine a service that requires a bearer token for authentication.
You can initialize a client/request by using
(oauth my-token)
as the base for all of your future pipelines to add authentication to all of them transparently.While additional features could be added on-demand (for instance, I can imagine someone wanting an "append parts to URL" feature), the primary APIs and their design are all done, and I am now using Jurl in production over at my dayjob.
I've been rather charmed by Janet (and especially its C API) and am interested to see in what direction the community will end up developing, especially now that it has a high quality (at least I would hope, it's certainly the nicest one I've used to date) HTTP client.
Beta Was this translation helpful? Give feedback.
All reactions