Module: FastCurl
- Defined in:
- lib/fast_curl.rb,
lib/fast_curl.rb,
lib/fast_curl/version.rb,
ext/fast_curl/fast_curl.c
Defined Under Namespace
Classes: Error, Headers, TimeoutError
Constant Summary collapse
- DEFAULT_OPTIONS =
{ connections: 20, timeout: 30 }.freeze
- METHODS =
%i[get post put delete patch].freeze
- BODY_METHODS =
%i[post put patch].freeze
- JSON_TYPE =
"application/json"- FORM_TYPE =
"application/x-www-form-urlencoded"- BINARY_TYPE =
"application/octet-stream"- VERSION =
"0.4.0"
Class Method Summary collapse
Class Method Details
.execute(*args) ⇒ Object
1703 1704 1705 1706 1707 |
# File 'ext/fast_curl/fast_curl.c', line 1703
static VALUE rb_fast_curl_execute(int argc, VALUE *argv, VALUE self) {
VALUE requests, options;
rb_scan_args(argc, argv, "1:", &requests, &options);
return internal_execute(requests, options, -1, 0);
}
|
.first_execute(*args) ⇒ Object
1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 |
# File 'ext/fast_curl/fast_curl.c', line 1709
static VALUE rb_fast_curl_first_execute(int argc, VALUE *argv, VALUE self) {
VALUE requests, options;
rb_scan_args(argc, argv, "1:", &requests, &options);
int count = 1;
if (!NIL_P(options)) {
Check_Type(options, T_HASH);
VALUE c = hash_aref_key(options, KEY_COUNT_OPT);
if (!NIL_P(c))
count = NUM2INT(c);
}
if (count <= 0)
rb_raise(rb_eArgError, "count must be positive");
return internal_execute(requests, options, count, 0);
}
|
.stream_execute(*args) ⇒ Object
1727 1728 1729 1730 1731 1732 1733 1734 1735 |
# File 'ext/fast_curl/fast_curl.c', line 1727
static VALUE rb_fast_curl_stream_execute(int argc, VALUE *argv, VALUE self) {
VALUE requests, options;
rb_scan_args(argc, argv, "1:", &requests, &options);
if (!rb_block_given_p())
rb_raise(rb_eArgError, "stream_execute requires a block");
return internal_execute(requests, options, -1, 1);
}
|