Skip to content

mattn/mruby-curl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

= mruby-curl

mruby-curl is an mruby wrapper for libcurl.

== Usage

Example:

curl = Curl.new

headers = {
  'User-Agent' => 'mruby-curl'
}

response = curl.get("http://www.ruby-lang.org/ja/", headers)

puts response.body

mruby-curl has support for HTTP methods DELETE, GET, PATCH, POST, and PUT through instance methods on the Curl object and supports arbitrary HTTP requests using Curl#send with an HTTP::Request object from mruby-http.

=== Use HTTP 1.0 instead of 1.1

curl = Curl.new
Curl::HTTP_VERSION = Curl::HTTP_1_0
response = curl.get("http://www.ruby-lang.org/ja/")

== Threaded use

By default mruby-curl does not call curl_global_init. If you are using mruby-curl in a multithreaded environment you must call it yourself.

If threads are started from within mruby the Curl.global_init method will initialize curl with the default flags. You must call it before starting threads that will use mruby-curl methods.

If mruby is started from a multi-threaded program you must call curl_global_init before starting any mruby threads.

See the curl_global_init documentation for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published