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.
- data/lib/remote_api/base.rb +6 -5
- data/lib/remote_api/version.rb +1 -1
- metadata +2 -2
data/lib/remote_api/base.rb
CHANGED
@@ -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
|
72
|
-
|
73
|
-
|
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,
|
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
|
data/lib/remote_api/version.rb
CHANGED
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.
|
7
|
-
date: 2007-
|
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
|