README.md in my_api_client-0.26.0 vs README.md in my_api_client-0.27.0
- old
+ new
@@ -14,12 +14,12 @@
[toc]
## Supported Versions
-- Ruby 2.7, 3.0, 3.1, 3.2
-- Rails 6.0, 6.1, 7.0
+- Ruby 3.0, 3.1, 3.2
+- Rails 6.1, 7.0
## Installation
Add this line to your application's Gemfile:
@@ -54,19 +54,19 @@
@access_token = access_token
end
# GET https://example.com/v1/users
#
- # @return [Sawyer::Response] HTTP response parameter
+ # @return [Sawyer::Resource] HTTP resource parameter
def get_users
get 'users', headers: headers, query: { key: 'value' }
end
# POST https://example.com/v1/users
#
# @param name [String] Username which want to create
- # @return [Sawyer::Response] HTTP response parameter
+ # @return [Sawyer::Resource] HTTP resource parameter
def post_user(name:)
post 'users', headers: headers, body: { name: name }
end
private
@@ -78,10 +78,10 @@
}
end
end
api_clinet = ExampleApiClient.new(access_token: 'access_token')
-api_clinet.get_users #=> #<Sawyer::Response>
+api_clinet.get_users #=> #<Sawyer::Resource>
```
The `endpoint` defines the intersection of the request URL. Each method described below defines a subsequent path. In the above example, `get 'users'` will request to `GET https://example.com/v1/users`.
Next, define `#initialize`. Suppose you want to set an Access Token, API Key, etc. as in the example above. You can omit the definition if you don't need it.