[Enhancement] allow using custom Client#158
[Enhancement] allow using custom Client#158thinkingserious merged 1 commit intosendgrid:masterfrom dmaicher:client-customization
Conversation
| Client client = mock(Client.class); | ||
| SendGrid sg = new SendGrid(SENDGRID_API_KEY, client); | ||
| Request request = new Request(); | ||
| sg.makeCall(request); |
There was a problem hiding this comment.
instead of using a mock I could also add a getter for the client and make sure its the one we passed into the constructor. Opinions? 😊
There was a problem hiding this comment.
I am sending Email with attachments. I want to set ConnectionTimeout values like shown above, But Not able to figure out where to set. I created Client object. I used abovbe 4 lines. But I do no see any API on Client or SendGrid to set timeout values. Can someone please help me with this.
|
Something seems to be wrong in general with the build? Well the test I added should be passing 😉 |
|
And btw I think this PR should be favoured instead of #119 as the SendGrid class should have no knowledge about the http client implementation which is an internal detail of the |
|
Thanks for the PR @dmaicher, It looks good to me. I'll be looking forward to your signed CLA :) To test locally, please follow steps 3-5 here: https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md#initial-setup With Best Regards, Elmer |
|
@thinkingserious I emailed the CLA 😉 |
|
+1 lgtm |
…ustom Client, http proxy support
Issues: #138 & sendgrid/java-http-client#8
Will allow to pass in a custom
Client(that itself might have a customCloseableHttpClientto use proxies for example).I can provide a signed CLA once I know this PR makes sense as it is 😉