A Set of HTTP verbs that typically send a body. If no body is set for these requests, the Content-Length header is set to 0.
Public
# File lib/faraday/options.rb, line 273 def self.from(value) env = super(value) if value.respond_to?(:custom_members) env.custom_members.update(value.custom_members) end env end
Internal
# File lib/faraday/options.rb, line 355 def self.member_set @member_set ||= Set.new(members) end
Public
# File lib/faraday/options.rb, line 282 def [](key) if in_member_set?(key) super(key) else custom_members[key] end end
Public
# File lib/faraday/options.rb, line 291 def []=(key, value) if in_member_set?(key) super(key, value) else custom_members[key] = value end end
Public
# File lib/faraday/options.rb, line 310 def clear_body request_headers[ContentLength] = '0' self.body = '' end
Internal
# File lib/faraday/options.rb, line 339 def custom_members @custom_members ||= {} end
# File lib/faraday/options.rb, line 345 def in_member_set?(key) self.class.member_set.include?(key.to_sym) end
# File lib/faraday/options.rb, line 325 def inspect attrs = [nil] members.each do |mem| if value = send(mem) attrs << "@#{mem}=#{value.inspect}" end end if !custom_members.empty? attrs << "@custom=#{custom_members.inspect}" end %Q(#<#{self.class}#{attrs.join(" ")}>) end
Public
# File lib/faraday/options.rb, line 305 def needs_body? !body && MethodsWithBodies.include?(method) end
Public
# File lib/faraday/options.rb, line 321 def parallel? !!parallel_manager end
Public
# File lib/faraday/options.rb, line 316 def parse_body? !StatusesWithoutBody.include?(status) end
Public
# File lib/faraday/options.rb, line 300 def success? SuccessfulStatuses.include?(status) end