Skip to content

Commit

Permalink
Added documentation in the readme about headers
Browse files Browse the repository at this point in the history
  • Loading branch information
katylouise committed Mar 31, 2017
1 parent ffdf42d commit 30956fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,19 @@ parliament.parties('123').people.current
parliament.people('123').letters('456')
```

### Setting headers

#### Setting headers 'globally'
Within the code you can set global headers using the following snippet.
```
Parliament::Request.headers = { 'Accept' => 'Test' }
# The headers should be set for all new objects
Parliament::Request.new.headers #=> { 'Accept' => 'Test' }
# You can still override the headers on an instance by instance basis
Parliament::Request.new(headers: { 'Accept' => 'Test2' }).headers #=> { 'Accept' => 'Test2' }
```
### Methods
[parliament-ruby][parliament-ruby] comes with the following common methods:

Expand Down

0 comments on commit 30956fc

Please sign in to comment.