kounta_rest 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,8 +26,8 @@ module Kounta
26
26
 
27
27
  def perform(url_hash, request_method, options={})
28
28
  begin
29
- log("#{request_method}: #{Kounta::SITE_URI}#{path_from_hash(url_hash)}.#{FORMAT.to_s} (#{options})")
30
- response = @conn.request(request_method, "#{path_from_hash(url_hash)}.#{FORMAT.to_s}", options)
29
+ log("#{request_method}: #{Kounta::SITE_URI}#{path_from_hash(url_hash)}.#{FORMAT.to_s} (#{Oj.dump(options[:body])})")
30
+ response = @conn.request(request_method, "#{path_from_hash(url_hash)}.#{FORMAT.to_s}", options.merge(REQUEST_HEADERS))
31
31
  rescue OAuth2::Error => ex
32
32
  if ex.message.include? 'The access token provided has expired'
33
33
  log(ex.message)
@@ -1,3 +1,3 @@
1
1
  module Kounta
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/kounta.rb CHANGED
@@ -22,6 +22,7 @@ module Kounta
22
22
  TOKEN_URI = "https://api.kounta.com/v1/token.json"
23
23
  SITE_URI = "https://api.kounta.com/v1/"
24
24
  FORMAT = :json
25
+ REQUEST_HEADERS = {'Content-Type' => 'application/json'}
25
26
 
26
27
  def self.log(message)
27
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kounta_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler