http_request.rb 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +2 -2
- data/README.rdoc +2 -2
- data/lib/http_request.rb +7 -7
- metadata +4 -14
data/Changelog
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
v1.1.11
|
2
|
-
* define http methods such as "get", "post" etc.
|
2
|
+
* define http methods such as "get", "post" etc. dynamically instead of
|
3
3
|
using "method_missing".
|
4
4
|
|
5
5
|
v1.1.10
|
6
|
-
* make it
|
6
|
+
* make it works on Ruby1.9.2
|
7
7
|
|
8
8
|
v1.1.9
|
9
9
|
* re-format code with 2 spaces and fixed the version number
|
data/README.rdoc
CHANGED
@@ -209,7 +209,7 @@ download multiple files from a directory
|
|
209
209
|
|
210
210
|
== check whether or not the remote site is available (since v1.0.3)
|
211
211
|
|
212
|
-
# return true if can access to the website with socket
|
212
|
+
# return true if can access to the website with socket connection even it is a 500 or 404 page, otherwise, return false
|
213
213
|
HttpRequest.available?('http://www.github.com/')
|
214
214
|
|
215
215
|
== send XML data via the post method (since v1.0.4)
|
@@ -228,4 +228,4 @@ download multiple files from a directory
|
|
228
228
|
bug fixing, testing and testing...
|
229
229
|
|
230
230
|
== LATEST VERSION
|
231
|
-
1.1.
|
231
|
+
1.1.12
|
data/lib/http_request.rb
CHANGED
@@ -11,9 +11,9 @@
|
|
11
11
|
#
|
12
12
|
# == Version
|
13
13
|
#
|
14
|
-
# v1.1.
|
14
|
+
# v1.1.12
|
15
15
|
#
|
16
|
-
# Last Change:
|
16
|
+
# Last Change: 21 May, 2012
|
17
17
|
#
|
18
18
|
# == Author
|
19
19
|
#
|
@@ -32,10 +32,10 @@ class HttpRequest
|
|
32
32
|
include Singleton
|
33
33
|
class << self
|
34
34
|
# version
|
35
|
-
VERSION = '1.1.
|
35
|
+
VERSION = '1.1.12'.freeze
|
36
36
|
def version;VERSION;end
|
37
37
|
|
38
|
-
#
|
38
|
+
# available http methods
|
39
39
|
def http_methods
|
40
40
|
%w{get head post put proppatch lock unlock options propfind delete move copy mkcol trace}
|
41
41
|
end
|
@@ -274,7 +274,7 @@ class HttpRequest
|
|
274
274
|
# ajax calls?
|
275
275
|
@headers['X-Requested-With'] = 'XMLHttpRequest' if @options[:ajax] or @options[:xhr]
|
276
276
|
|
277
|
-
# Http
|
277
|
+
# Http Authentication
|
278
278
|
parse_http_auth
|
279
279
|
|
280
280
|
# headers
|
@@ -391,14 +391,14 @@ class HttpRequest
|
|
391
391
|
end
|
392
392
|
h = http.method(@options[:method]).call(path, @headers)
|
393
393
|
else
|
394
|
-
h = http.method(@options[:method]).call(@uri.path, @options[:parameters], @headers)
|
394
|
+
h = http.method(@options[:method]).call("#{@uri.path}?#{@uri.query}", @options[:parameters], @headers)
|
395
395
|
end
|
396
396
|
|
397
397
|
self.class.update_cookies h
|
398
398
|
h
|
399
399
|
end
|
400
400
|
|
401
|
-
# process the
|
401
|
+
# process the redirection if need
|
402
402
|
def process_redirection(response, &block)
|
403
403
|
case response
|
404
404
|
when Net::HTTPRedirection
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_request.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 1
|
8
|
-
- 11
|
9
|
-
version: 1.1.11
|
4
|
+
prerelease:
|
5
|
+
version: 1.1.12
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- xianhua.zhou
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
13
|
+
date: 2012-05-21 00:00:00 Z
|
19
14
|
dependencies: []
|
20
15
|
|
21
16
|
description:
|
@@ -32,7 +27,6 @@ files:
|
|
32
27
|
- lib/http_request.rb
|
33
28
|
- test/test_http_request.rb
|
34
29
|
- test/web_server.rb
|
35
|
-
has_rdoc: true
|
36
30
|
homepage: http://github.com/xianhuazhou
|
37
31
|
licenses: []
|
38
32
|
|
@@ -46,21 +40,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
40
|
requirements:
|
47
41
|
- - ">="
|
48
42
|
- !ruby/object:Gem::Version
|
49
|
-
segments:
|
50
|
-
- 0
|
51
43
|
version: "0"
|
52
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
45
|
none: false
|
54
46
|
requirements:
|
55
47
|
- - ">="
|
56
48
|
- !ruby/object:Gem::Version
|
57
|
-
segments:
|
58
|
-
- 0
|
59
49
|
version: "0"
|
60
50
|
requirements: []
|
61
51
|
|
62
52
|
rubyforge_project: http_request.rb
|
63
|
-
rubygems_version: 1.
|
53
|
+
rubygems_version: 1.8.17
|
64
54
|
signing_key:
|
65
55
|
specification_version: 3
|
66
56
|
summary: http_request.rb is a small, lightweight, powerful HttpRequest class based on the 'net/http' and 'net/ftp' libraries
|