mashape 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/http_client.rb +9 -3
  2. metadata +3 -3
@@ -1,6 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'addressable/uri'
3
3
  require 'rest-client'
4
+ require 'json'
4
5
  require File.join(File.dirname(__FILE__), "/authentication/mashape_authentication.rb")
5
6
  require File.join(File.dirname(__FILE__), "/authentication/custom_header_authentication.rb")
6
7
  require File.join(File.dirname(__FILE__), "/authentication/query_authentication.rb")
@@ -36,10 +37,7 @@ module Mashape
36
37
 
37
38
  headers = {}
38
39
  if parameters == nil
39
- case content_type
40
- when :form || :binary
41
40
  parameters = {}
42
- end
43
41
  end
44
42
 
45
43
  # figure out what kind of auth we have and where to put it
@@ -68,6 +66,14 @@ module Mashape
68
66
 
69
67
  Mashape::HttpUtils.setRequestHeaders(content_type, response_type, headers)
70
68
 
69
+ if(content_type == :json)
70
+ unless parameters[:json_param_body] == nil
71
+ parameters = JSON(parameters[:json_param_body])
72
+ else
73
+ parameters = {}
74
+ end
75
+ end
76
+
71
77
  begin
72
78
  case method
73
79
  when :get
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 5
9
- version: 2.0.5
8
+ - 6
9
+ version: 2.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mashape
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-10-11 00:00:00 -07:00
17
+ date: 2012-11-18 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency