summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authormo <mo@mokhan.ca>2018-05-07 15:23:33 -0600
committermo <mo@mokhan.ca>2018-05-07 15:23:33 -0600
commit6bb6fdb072c576a4d80e0e1869049ea122738695 (patch)
treed2f6b92afbc206a5c84e5fe807cf7e25dc9ad1eb /README.md
parent54ab2db6336b1116927200d6afc25e2af35282c8 (diff)
do not accept default headers in ctor.v0.1.2
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 12 insertions, 3 deletions
diff --git a/README.md b/README.md
index c6acf03..ecbad05 100644
--- a/README.md
+++ b/README.md
@@ -26,12 +26,21 @@ require 'net/hippie'
Net::Hippie.logger = Rails.logger
-client = Net::Hippie::Client.new(headers: {
+client = Net::Hippie::Client.new
+
+headers = {
'Accept' => 'application/vnd.haveibeenpwned.v2+json'
-})
+}
-response = client.get(URI.parse('https://haveibeenpwned.com/api/breaches'))
+uri = URI.parse('https://haveibeenpwned.com/api/breaches')
+response = client.get(uri, headers: headers)
+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)
puts JSON.parse(response.body)
```