-
Notifications
You must be signed in to change notification settings - Fork 410
[Enhancement] allow using custom Client #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] allow using custom Client #158
Conversation
SendGrid sg = new SendGrid(SENDGRID_API_KEY, client); | ||
Request request = new Request(); | ||
sg.makeCall(request); | ||
verify(client).api(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 customCloseableHttpClient
to use proxies for example).I can provide a signed CLA once I know this PR makes sense as it is 😉