Skip to content

Commit ad0caae

Browse files
committed
Minor improvement to guide.
1 parent 6a10cc4 commit ad0caae

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

guides/getting-started/readme.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ $ bundle add async-http
2222

2323
### Making a Request
2424

25-
To make a request, create an instance of {ruby Async::HTTP::Internet} and call the appropriate method:
25+
To make a request, use {ruby Async::HTTP::Internet} and call the appropriate method:
2626

2727
~~~ ruby
28-
require 'async/http/internet'
28+
require 'async/http/internet/instance'
2929

3030
Sync do
3131
Async::HTTP::Internet.get("https://httpbin.org/get") do |response|
@@ -44,7 +44,7 @@ Async::HTTP::Internet.methods(false)
4444
Using a block will automatically close the response when the block completes. If you want to keep the response open, you can manage it manually:
4545

4646
~~~ ruby
47-
require 'async/http'
47+
require 'async/http/internet/instance'
4848

4949
Sync do
5050
response = Async::HTTP::Internet.get("https://httpbin.org/get")
@@ -63,7 +63,6 @@ By default, {ruby Async::HTTP::Internet} will create a {ruby Async::HTTP::Client
6363
### Downloading a File
6464

6565
~~~ ruby
66-
require 'async/http'
6766
require 'async/http/internet/instance'
6867

6968
Sync do
@@ -82,7 +81,6 @@ end
8281
To post data, use the `post` method:
8382

8483
~~~ ruby
85-
require 'async/http'
8684
require 'async/http/internet/instance'
8785

8886
data = {'life' => 42}
@@ -109,7 +107,6 @@ For more complex scenarios, including HTTP APIs, consider using [async-rest](htt
109107
To set a timeout for a request, use the `Task#with_timeout` method:
110108

111109
~~~ ruby
112-
require 'async/http'
113110
require 'async/http/internet/instance'
114111

115112
Sync do |task|

0 commit comments

Comments
 (0)