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.
Internal
# File lib/faraday/options.rb, line 346 def self.member_set @member_set ||= Set.new(members) end
Public
# File lib/faraday/options.rb, line 273 def [](key) if in_member_set?(key) super(key) else custom_members[key] end end
Public
# File lib/faraday/options.rb, line 282 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 301 def clear_body request_headers[ContentLength] = '0' self.body = '' end
Internal
# File lib/faraday/options.rb, line 330 def custom_members @custom_members ||= {} end
# File lib/faraday/options.rb, line 336 def in_member_set?(key) self.class.member_set.include?(key.to_sym) end
# File lib/faraday/options.rb, line 316 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 296 def needs_body? !body && MethodsWithBodies.include?(method) end
Public
# File lib/faraday/options.rb, line 312 def parallel? !!parallel_manager end
Public
# File lib/faraday/options.rb, line 307 def parse_body? !StatusesWithoutBody.include?(status) end
Public
# File lib/faraday/options.rb, line 291 def success? SuccessfulStatuses.include?(status) end