From 949e0234df56d06e1b4e58b159910b39627924cf Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Sat, 9 Oct 2021 22:23:33 +0900 Subject: [PATCH] add Mechanize class comment --- src/mechanize.cr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/mechanize.cr b/src/mechanize.cr index 6fcf332..dfba292 100644 --- a/src/mechanize.cr +++ b/src/mechanize.cr @@ -4,6 +4,28 @@ require "./mechanize/node" require "./mechanize/page" require "./mechanize/errors/*" +# This class is main class of Mechanize.cr, +# using this class' instance to start web interaction. +# +# now only supports GET, POST. other HTTP methods will be implemented soon... +# +# Examples: +# +# ``` +# # GET +# agent = Mechanize.new +# agent.get("http://example.com", +# params: {"foo" => "bar"}, +# headers: HTTP::Headers{"Foo" => "Bar"}) +# ``` +# +# ``` +# # POST +# # sending post request whose post body is "foo=bar" +# agent = Mechanize.new +# agent.post("http://example.com", +# query: {"foo" => "bar"}) +# ``` class Mechanize VERSION = "0.1.0"