minhttp 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -0
- data/README.md +38 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/cacert.pem +3987 -0
- data/examples/readme_example.rb +16 -0
- data/lib/minhttp.rb +112 -0
- data/lib/ssl_validator.rb +80 -0
- data/test/simple_test.rb +22 -0
- data/test/simple_test.rb~ +10 -0
- metadata +82 -0
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
MinHTTP
|
2
|
+
=======
|
3
|
+
|
4
|
+
An HTTP library for the minimalist. MinHTTP allows you to send and receive raw HTTP requests. It's a very thin wrapper around EventMachine's connect method with some SSL validation added. It uses http_parser.rb for very fast HTTP parsing.
|
5
|
+
|
6
|
+
Example:
|
7
|
+
|
8
|
+
require 'minhttp'
|
9
|
+
|
10
|
+
data = <<-HTTP
|
11
|
+
GET / HTTP/1.0\r
|
12
|
+
Host: www.google.com\r
|
13
|
+
|
14
|
+
HTTP
|
15
|
+
|
16
|
+
EventMachine::run do
|
17
|
+
Http::Min.connect("www.yahoo.com", data) do |raw_response, parsed_response|
|
18
|
+
puts "Received #{parsed_response.status_code} status from Google"
|
19
|
+
puts "First 100 characters of raw HTTP response:"
|
20
|
+
puts raw_response[0..100]
|
21
|
+
EM::stop
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
Features:
|
27
|
+
|
28
|
+
* Issue an exact HTTP request
|
29
|
+
* See the exact HTTP response
|
30
|
+
* See the parsed HTTP response
|
31
|
+
* Validate the certificate of the server
|
32
|
+
|
33
|
+
|
34
|
+
Non-Features:
|
35
|
+
|
36
|
+
* get() or post() helper methods (plenty of other HTTP libraries have these)
|
37
|
+
|
38
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|