From be4d84592176d709df793f14589e6bb6e19a7f2a Mon Sep 17 00:00:00 2001 From: Kanezoh <47489839+Kanezoh@users.noreply.github.com> Date: Mon, 24 Jan 2022 21:25:58 +0900 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28aff22..ae78100 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This project is inspired by Ruby's [mechanize](https://github.com/sparklemotion/mechanize). The purpose is to cover all the features of original one. -Now, mechanize.cr can automatically store and send cookies, fill and submit forms. + +[API Documentation](https://kanezoh.github.io/mechanize.cr/) ## Installation @@ -20,7 +21,7 @@ Now, mechanize.cr can automatically store and send cookies, fill and submit form ## Usage -### simple GET request +### GET request ```crystal require "mechanize" @@ -95,6 +96,17 @@ For activation, simply setup the log to `:debug` level Log.setup("mechanize", :debug) ``` +### Basic auth + +You can access a page which is protected by basic auth, setting username and password for the url. + +```crystal +agent = Mechanize.new +agent.add_auth("http://example.com", "username", "password") +agent.get("http://example.com") +``` + + ## Contributing 1. Fork it ()