remote_api 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,8 @@ class RemoteAPI
4
4
  dsl_accessor :debug
5
5
  dsl_accessor :log_file
6
6
  dsl_accessor :url
7
- dsl_accessor :content_type
7
+ dsl_accessor :content_type
8
+ dsl_accessor :headers
8
9
 
9
10
  class ResponseFailure < RuntimeError; end
10
11
 
@@ -68,12 +69,12 @@ class RemoteAPI
68
69
  http.use_ssl = true
69
70
  end
70
71
 
71
- # Setup request options
72
- options = {}
73
- options['ContentType'] = self.class.content_type if self.class.content_type
72
+ # Setup request headers
73
+ request_headers = self.class.headers || {}
74
+ request_headers['ContentType'] = self.class.content_type if self.class.content_type
74
75
 
75
76
  # Send Request
76
- response = http.post(url.path, request_body, options)
77
+ response = http.post(url.path, request_body, request_headers)
77
78
  debug_response(response.body, url)
78
79
 
79
80
  # Convert response to proper format
@@ -2,7 +2,7 @@ class RemoteAPI #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
3
3
  specification_version: 1
4
4
  name: remote_api
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-04-19 00:00:00 -07:00
6
+ version: 0.2.1
7
+ date: 2007-05-31 00:00:00 -07:00
8
8
  summary: Provides a basic framework for easily creating classes that access remote APIs.
9
9
  require_paths:
10
10
  - lib