Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1.1.13 is ready

  • Loading branch information...
commit 3e398da006be2e634aed18c0cc647f320a5aa0fb 1 parent c6f3c6e
@xianhuazhou authored
View
9 Changelog
@@ -1,3 +1,12 @@
+v1.1.13
+ * fixed cookies parser
+ * join utf-8 and ascii-8 bit form data
+ * testing with rspec now
+ * Gemfile added
+
+v1.1.12
+ * post method supports query string
+
v1.1.11
* define http methods such as "get", "post" etc. dynamically instead of
using "method_missing".
View
19 README.rdoc
@@ -58,8 +58,8 @@ fetch headers
}
fetch cookies
- hp = HttpRequest.get('http://www.yahoo.com')
- hp.cookies.each {|k, v|
+ hr = HttpRequest.get('http://www.yahoo.com')
+ hr.cookies.each {|k, v|
puts "#{k} => #{v}"
}
@@ -67,6 +67,19 @@ add cookies into header
HttpRequest.get(:url => 'http://www.example.com/', :cookies => {:login => 'Yes', :userid => 101})
HttpRequest.get(:url => 'http://www.example.com/', :cookies => 'login=Yes; userId=101')
+fetch cookies and add cookies
+ hr = HttpRequest.get('http://www.example.com/homepage')
+ hr = HttpRequest.post('http://www.example.com/login', :cookies => hr.cookies)
+ hr = HttpRequest.get('http://www.example.com/logout', :cookies => hr.cookies)
+
+store cookies with cookie jar (since v1.1.13)
+ # default :cookie_jar is "default"
+ hr1 = HttpRequest.post('http://hostname/request-cookies', :cookie_jar => 'user1')
+ hr2 = HttpRequest.post('http://hostname/request-cookies', :cookie_jar => 'user2')
+
+ hr1 = HttpRequest.post('http://hostname/send-cookies', :cookie_jar => 'user1', :cookies => hr1.cookies)
+ hr2 = HttpRequest.post('http://hostname/send-cookies', :cookie_jar => 'user2', :cookies => hr2.cookies)
+
upload file by post method
HttpRequest.post(
:url => 'http://localhost/upload.php',
@@ -228,4 +241,4 @@ download multiple files from a directory
bug fixing, testing and testing...
== LATEST VERSION
- 1.1.12
+ 1.1.13
View
4 http_request.gemspec
@@ -3,12 +3,12 @@ SPEC=Gem::Specification.new do |s|
s.homepage = 'http://github.com/xianhuazhou'
s.rubyforge_project = "http_request.rb"
s.name = 'http_request.rb'
- s.version = '1.1.12'
+ s.version = '1.1.13'
s.author = 'xianhua.zhou'
s.email = 'xianhua.zhou@gmail.com'
s.platform = Gem::Platform::RUBY
s.summary = "http_request.rb is a small, lightweight, powerful HttpRequest class based on the 'net/http' and 'net/ftp' libraries"
- s.files = %w(Changelog README.rdoc lib/http_request.rb test/test_http_request.rb test/web_server.rb)
+ s.files = %w(Changelog README.rdoc Gemfile Rakefile lib/http_request.rb spec/test_http_request.rb spec/web_server.rb)
s.require_path = 'lib'
s.has_rdoc = true
end
View
6 lib/http_request.rb
@@ -11,9 +11,9 @@
#
# == Version
#
-# v1.1.12
+# v1.1.13
#
-# Last Change: 21 May, 2012
+# Last Change: 29 July, 2012
#
# == Author
#
@@ -32,7 +32,7 @@ class HttpRequest
include Singleton
class << self
# version
- VERSION = '1.1.12'.freeze
+ VERSION = '1.1.13'.freeze
def version;VERSION;end
# available http methods

0 comments on commit 3e398da

Please sign in to comment.
Something went wrong with that request. Please try again.