googlebase 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +1 -0
- data/lib/google/base.rb +12 -2
- data/lib/google/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/google/base.rb
CHANGED
@@ -60,12 +60,22 @@ module Google
|
|
60
60
|
#
|
61
61
|
# Usage:
|
62
62
|
# post('http://google.com/some/thing', :form_data => {:one => '1', :two => '2'})
|
63
|
-
# # makes a post request to http://google.com/some/thing with the
|
63
|
+
# # makes a post request to http://google.com/some/thing with the post data set to one=1&two=2
|
64
|
+
# post('http://google.com/some/thing', :raw_data => "some=thing&another=thing")
|
65
|
+
# # makes a post request to http://google.com/some/thing with the post data set to some=thing&another=thing
|
64
66
|
def post(url, o={})
|
65
67
|
options = {
|
66
68
|
:form_data => nil,
|
69
|
+
:raw_data => nil,
|
67
70
|
}.merge(o)
|
68
|
-
|
71
|
+
if options[:raw_data]
|
72
|
+
url = URI.parse(url)
|
73
|
+
http = Net::HTTP.new(url.host, url.port)
|
74
|
+
result = http.request_post(url.request_uri, options[:raw_data], @@connection.headers)
|
75
|
+
result.body
|
76
|
+
else
|
77
|
+
request 'post', url, options
|
78
|
+
end
|
69
79
|
end
|
70
80
|
|
71
81
|
private
|
data/lib/google/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: googlebase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ""
|
6
6
|
authors:
|
7
7
|
- John
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2007-
|
12
|
+
date: 2007-12-26 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|