foreign-c-libraries/retropikzel/requests/README.md

1.8 KiB

requests

Scheme library to make https requests. Built with foreign c and libcurl.

Repository

Issue tracker

Jenkins

Caveats

  • Not yet working on Mosh
  • No cookie reading support yet

Dependencies

Depends on libcurl, on Debian/Ubuntu:

apt-get install libcurl4-openssl-dev

or apt-get install libcurl4-gnutls-dev

Documentation

(request method url . option ...)

Method is http method as a symbol. For example 'GET or 'POST.

Url is the url you want to make request to.

Options are pairs passed in after other arguments, for example:

(define url "https://snow-fort.org/s/gmail.com/nma.arvydas.silanskas/arvyy/mustache/1.0.2/arvyy-mustache-1.0.2.tgz")
(request 'GET url '(download-path . "/tmp/arvyy-mustache-1.0.2.tgz"))

Options:

  • download-path
    • Downloads the response of request to given path
    • If this is not given temporary file is used and deleted after
  • headers
    • An association list of headers
  • body

(response-status-code response)

Returns the HTTP status code of the response.

(response-text response)

Returns the content of the response as text.

(response-bytes response)

Returns the content of the response as bytes.

(response-headers response)

Returns the response headers as an association list. Header names are downcased symbols.