Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Correct formatting in header.rb #90

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions lib/net/http/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get_fields(key)
@header[stringified_downcased_key].dup
end

# :call-seq
# call-seq:
# fetch(key, default_val = nil) {|key| ... } -> object
# fetch(key, default_val = nil) -> value or default_val
#
Expand Down Expand Up @@ -540,7 +540,7 @@ def range
result
end

# :call-seq:
# call-seq:
# set_range(length) -> length
# set_range(offset, length) -> range
# set_range(begin..length) -> range
Expand Down Expand Up @@ -772,6 +772,7 @@ def set_content_type(type, params = {})
# application/x-www-form-urlencoded
#
# Example:
#
# http.form_data = {"q" => "ruby", "lang" => "en"}
# http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
# http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
Expand Down Expand Up @@ -801,12 +802,14 @@ def set_form_data(params, sep = '&')
#
# Each item of params should respond to +each+ and yield 2-3 arguments,
# or an array of 2-3 elements. The arguments yielded should be:
# * The name of the field.
# * The value of the field, it should be a String or a File or IO-like.
# * An options hash, supporting the following options, only
# used for file uploads:
# :filename :: The name of the file to use.
# :content_type :: The content type of the uploaded file.
#
# - The name of the field.
# - The value of the field, it should be a String or a File or IO-like.
# - An options hash, supporting the following options
# (used only for file uploads); entries:
#
# - +:filename+: The name of the file to use.
# - +:content_type+: The content type of the uploaded file.
#
# Each item is a file field or a normal field.
# If +value+ is a File object or the +opt+ hash has a :filename key,
Expand All @@ -818,6 +821,7 @@ def set_form_data(params, sep = '&')
# chunked encoding.
#
# Example:
#
# req.set_form([["q", "ruby"], ["lang", "en"]])
#
# req.set_form({"f"=>File.open('/path/to/filename')},
Expand Down