Commit a247acd
Changed files (2)
lib
net
hippie
lib/net/hippie/version.rb
@@ -2,6 +2,6 @@
module Net
module Hippie
- VERSION = '0.1.9'
+ VERSION = '0.1.10'
end
end
README.md
@@ -40,7 +40,7 @@ puts JSON.parse(response.body)
```ruby
client = Net::Hippie::Client.new
body = { user: { name: 'hippie' } }
-response = client.post(URI.parse('https://example.com'), body: body)
+response = client.post(URI.parse('https://example.org'), body: body)
puts JSON.parse(response.body)
```
@@ -63,6 +63,22 @@ client = Net::Hippie::Client.new(
)
```
+### Basic Auth
+
+```ruby
+client = Net::Hippie::Client.new
+headers = { 'Authorization' => Net::Hippie.basic_auth('username', 'password') }
+client.get('https://www.example.org', headers: headers)
+```
+
+### Bearer Auth
+
+```ruby
+client = Net::Hippie::Client.new
+headers = { 'Authorization' => Net::Hippie.bearer_auth('token') }
+client.get('https://www.example.org', headers: headers)
+```
+
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.