Skip to content

Commit de63561

Browse files
committed
Add documentation regarding header mutation. Fixes #99.
1 parent 8ee4977 commit de63561

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/async/http/internet.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ def client_for(endpoint)
4747
end
4848
end
4949

50+
# Make a request to the internet with the given `method` and `url`.
51+
#
52+
# If you provide non-frozen headers, they may be mutated.
53+
#
54+
# @parameter method [String] The request method, e.g. `GET`.
55+
# @parameter url [String] The URL to request, e.g. `https://www.codeotaku.com`.
56+
# @parameter headers [Hash | Protocol::HTTP::Headers] The headers to send with the request.
57+
# @parameter body [String | Protocol::HTTP::Body] The body to send with the request.
5058
def call(method, url, headers = nil, body = nil)
5159
endpoint = Endpoint.parse(url)
5260
client = self.client_for(endpoint)

0 commit comments

Comments
 (0)