curl-crystal

Bindings for libcurl libcurl curl
0.1.2 released

libcurl for Crystal Build Status

Crystal C bindings for libcurl, the multiprotocol file transfer library - see libcurl

Installation

Add this to your application's shard.yml:

dependencies:
  curl-crystal:
    github: blocknotes/curl-crystal

Usage

CURL version:

require "curl-crystal"
puts String.new LibCurl.curl_version

Fetch an URL an print the content to the STDOUT:

require "curl-crystal"
curl = LibCurl.curl_easy_init  # init
LibCurl.curl_easy_setopt curl, LibCurl::CURLoption::CURLOPT_URL, "https://www.google.com"  # set URL
LibCurl.curl_easy_setopt curl, LibCurl::CURLoption::CURLOPT_FOLLOWLOCATION, 1  # follow redirect
LibCurl.curl_easy_perform curl  # run
LibCurl.curl_easy_cleanup curl  # deinit

More examples

Notes

Base on curl version: 7.52.1

Contributors

curl-crystal:
  github: blocknotes/curl-crystal
  version: ~> 0.1.2
License MIT
Crystal 0.20.3

Authors

Dependencies 0

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently