change directory structure
parent
850a2c6d68
commit
303dac9795
2
main.cr
2
main.cr
|
@ -2,5 +2,5 @@ require "./src/mechanize.cr"
|
|||
|
||||
agent = Mechanize.new
|
||||
agent.request_headers = HTTP::Headers{"Foo" => "Bar"}
|
||||
page = agent.get("https://example.com")
|
||||
page = agent.get("https://example.com/")
|
||||
puts page
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require "./http/agent"
|
||||
require "./mechanize/http/agent"
|
||||
|
||||
class Mechanize
|
||||
VERSION = "0.1.0"
|
||||
|
|
|
@ -12,6 +12,7 @@ module MechanizeCr
|
|||
|
||||
def fetch(uri, method = :get, headers = HTTP::Headers.new)
|
||||
add_request_headers(headers)
|
||||
|
||||
response = http_request uri, method
|
||||
puts response.not_nil!.body
|
||||
end
|
Loading…
Reference in New Issue