Module: HTTPX::Plugins::Expect

Defined in:
lib/httpx/plugins/expect.rb

Overview

This plugin makes all HTTP/1.1 requests with a body send the “Expect: 100-continue”.

gitlab.com/os85/httpx/wikis/Expect#expect

Defined Under Namespace

Modules: ConnectionMethods, InstanceMethods, OptionsMethods, RequestMethods Classes: Store

Constant Summary collapse

EXPECT_TIMEOUT =
2
NOEXPECT_STORE_MUTEX =
Thread::Mutex.new

Class Method Summary collapse

Class Method Details

.extra_options(options) ⇒ Object



42
43
44
# File 'lib/httpx/plugins/expect.rb', line 42

def extra_options(options)
  options.merge(expect_timeout: EXPECT_TIMEOUT)
end

.no_expect_storeObject



34
35
36
37
38
39
40
# File 'lib/httpx/plugins/expect.rb', line 34

def no_expect_store
  return Ractor.store_if_absent(:httpx_no_expect_store) { Store.new } if Utils.in_ractor?

  @no_expect_store ||= NOEXPECT_STORE_MUTEX.synchronize do
    @no_expect_store || Store.new
  end
end