diff --git a/main.cr b/main.cr index d47039f..842bf3c 100644 --- a/main.cr +++ b/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 diff --git a/src/mechanize.cr b/src/mechanize.cr index f12ed82..94b04c7 100644 --- a/src/mechanize.cr +++ b/src/mechanize.cr @@ -1,4 +1,4 @@ -require "./http/agent" +require "./mechanize/http/agent" class Mechanize VERSION = "0.1.0" diff --git a/src/http/agent.cr b/src/mechanize/http/agent.cr similarity index 98% rename from src/http/agent.cr rename to src/mechanize/http/agent.cr index 68c921d..aa86ad5 100644 --- a/src/http/agent.cr +++ b/src/mechanize/http/agent.cr @@ -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