Popularity
5.4
Stable
Activity
0.0
Stable
14
5
5
Programming language: Crystal
License: MIT License
Tags:
Low Level Bindings
Latest version: v0.1.3
curl-crystal alternatives and similar shards
Based on the "Low level bindings" category.
Alternatively, view curl-crystal alternatives based on common mentions on social networks and blogs.
-
termbox-crystal
Bindings, wrapper, and utilities for termbox (terminal interface library) in Crystal -
serialport.cr
Crystal bindings for libserialport: cross-platform library for accessing serial ports.
InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
Promo
www.influxdata.com
Do you think we are missing an alternative of curl-crystal or a related project?
README
libcurl for Crystal - PROJECT UNMAINTAINED
This project is not maintained anymore
If you like it or continue to use it fork it please.
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
Simple POST request:
require "curl-crystal"
curl = LibCurl.curl_easy_init # init
LibCurl.curl_easy_setopt curl, LibCurl::CURLoption::CURLOPT_URL, "http://localhost"
LibCurl.curl_easy_setopt curl, LibCurl::CURLoption::CURLOPT_POSTFIELDS, "param1=Just+a+test¶m2=12.345"
LibCurl.curl_easy_perform curl # run
LibCurl.curl_easy_cleanup curl # deinit
Invalid URL error:
require "curl-crystal"
curl = LibCurl.curl_easy_init
LibCurl.curl_easy_setopt curl, LibCurl::CURLoption::CURLOPT_URL, "https://aaa.bbb.ccc.ddd"
ret = LibCurl.curl_easy_perform curl # CURLE_COULDNT_RESOLVE_HOST
puts ret.to_s + ": " + String.new( LibCurl.curl_easy_strerror( ret ) )
LibCurl.curl_easy_cleanup curl
More examples
Notes
Base on curl version: 7.52.1
Contributors
- Mattia Roccoberton - creator, maintainer, Crystal fan :)