Skip to content

pyrmont/churlish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Churlish

Test Status

Churlish is a pure Janet library for calling out to curl, the CLI tool.

Rationale

You want to make an HTTP request with Janet. The problem is that every URL you want to reach requires the call to go over HTTPS and Janet doesn't support secure network requests out of the box. What to do?

You could use a wrapper around libcurl but now you need to compile your code and make sure you have the appropriate libcurl development package for your system. But wait, your system almost certainly has curl already. Janet has excellent support for calling out to external executables. Can't we just do that?

Enter Churlish. Churlish presents a simple API that works the way you'd expect. You give it a URL, it gives you back the HTTP request as structured data!

Library

Installation

Add the dependency to your project.janet file:

(declare-project
  :dependencies ["https://github.com/pyrmont/churlish"])

Usage

Churlish can be used like this:

(import churlish)

(churlish/http-get "https://example.org")
# => @{:body "..." :headers @{ ... } :protocol "HTTP/2" :reason "" :status 200}}

Check out the API document for more information.

Bugs

Found a bug? I'd love to know about it. The best way is to report your bug in the Issues section on GitHub.

Licence

Churlish is licensed under the MIT Licence. See LICENSE for more details.

About

A wrapper around the CLI tool, curl

Topics

Resources

License

Stars

Watchers

Forks

Languages