Skip to content

Commit 5f110ad

Browse files
committed
Document new proxy capability
1 parent 715934a commit 5f110ad

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ client = Boxr::Client.new('zX3UjFwNerOy5PSWc2WI8aJgMHtAjs8T',
9999

100100
# You can provide another parameter called as_user. Read about what that means here: https://developer.box.com/reference#as-user-1
101101

102-
# You can provide yet another parameter called identifier. This can be used, for example, to
102+
# You can provide another parameter called identifier. This can be used, for example, to
103103
# hold the id of the user associated with this Boxr client. When the callback is invoked this value
104104
# will be provided.
105105
```
@@ -115,6 +115,7 @@ initialize( access_token=ENV['BOX_DEVELOPER_TOKEN'],
115115
jwt_public_key_id: ENV['JWT_PUBLIC_KEY_ID'],
116116
identifier: nil,
117117
as_user: nil,
118+
proxy: nil,
118119
&token_refresh_listener)
119120
```
120121

@@ -132,6 +133,14 @@ updated_file = client.create_shared_link_for_file(file, access: :open)
132133
puts "Shared Link: #{updated_file.shared_link.url}"
133134
```
134135

136+
### Using a proxy
137+
You can provide a proxy to Boxr::Client.new by passing the proxy parameter.
138+
```ruby
139+
client = Boxr::Client.new(proxy: 'http://username:[email protected]:8080')
140+
```
141+
Boxr uses HTTPClient under the hood, so you can use all the features of HTTPClient's proxy support.
142+
See https://www.rubydoc.info/gems/httpclient/HTTPClient#proxy=-instance_method for more details.
143+
135144
### NOTE: Using HTTP mocking libraries for testing
136145
When using HTTP mocking libraries for testing, you may need to set Boxr::BOX_CLIENT to a fresh instance of HTTPClient in your test setup after loading the HTTP mocking library. For example, when using WebMock with RSpec you might could add the following to your RSpec configuration:
137146
``` ruby
@@ -319,7 +328,9 @@ delete_comment(comment)
319328
```
320329
#### [Collaborations](https://developer.box.com/en/reference/resources/collaboration/)
321330
```ruby
322-
folder_collaborations(folder)
331+
folder_collaborations(folder, fields: [], limit: DEFAULT_LIMIT, marker: nil)
332+
333+
file_collaborations(file, fields: [], limit: DEFAULT_LIMIT, marker: nil)
323334

324335
add_collaboration(folder, accessible_by, role, fields: [], notify: nil)
325336

0 commit comments

Comments
 (0)