diff options
| author | mokha <mokha@cisco.com> | 2018-11-10 09:47:36 -0700 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-11-10 09:47:36 -0700 |
| commit | a247acd75e953221cee80262eba278916bb73f8c (patch) | |
| tree | 1ef7fc59d0644f57a569bf12e99448ae94c41753 /README.md | |
| parent | 864a74e3a3a0fc3317d1662306bdfce1ec58b298 (diff) | |
update README and bump version.
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. |
