diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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. |
