sendgrid / sendgrid-ruby

The Official Twilio SendGrid Led, Community Driven Ruby API Library
https://sendgrid.com
MIT License
621 stars 324 forks source link

Unable to pass HTTP options when initializing SendGrid Client #406

Closed adamnoto closed 4 years ago

adamnoto commented 4 years ago

Issue Summary

I cannot pass http_options because the Gem depends on an older version of ruby_http_client.

client = SendGrid::Client.new(host: host,
                              request_headers: headers,
                              http_options: {open_timeout: 15, read_timeout: 30})

Steps to Reproduce

  1. Add sendgrid-ruby with version set to 6.0.4, into the Gemfile
  2. Run the above code
  3. Error happened!
    ArgumentError: unknown keyword: http_options
    from /usr/local/bundle/gems/ruby_http_client-3.3.0/lib/ruby_http_client.rb:39:in `initialize'

Code Snippet

client = ::SendGrid::Client.new(host: host, request_headers: {}, http_options: {})

Exception/Log

ArgumentError: unknown keyword: http_options

Technical details:

childish-sambino commented 4 years ago

Fixed in the 6.1.0 release.