Skip to content


Added user agent to request method #14

merged 2 commits into from

2 participants


Untested! For #13

@hmarr hmarr merged commit eab2e6c into master
@greysteil greysteil deleted the user-agent branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2012
  1. @DHS

    Added user agent to request method

    DHS committed
Commits on Apr 3, 2012
  1. @hmarr

    Fix user agent version

    hmarr committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/gocardless/client.rb
1 lib/gocardless/client.rb
@@ -270,6 +270,7 @@ def request(method, path, opts = {})
opts[:headers] = {} if opts[:headers].nil?
opts[:headers]['Accept'] = 'application/json'
opts[:headers]['Content-Type'] = 'application/json' unless method == :get
+ opts[:headers]['User-Agent'] = "gocardless-ruby-v#{GoCardless::VERSION}"
opts[:body] = JSON.generate(opts[:data]) if !opts[:data].nil?
# Reset the URL in case the environment / base URL has been changed.
Something went wrong with that request. Please try again.