Sam Ford b4757af656
livecheck: Add support for POST requests
livecheck currently doesn't support `POST` requests but it wasn't
entirely clear how best to handle that. I initially approached it as
a `Post` strategy but unfortunately that would have required us to
handle response body parsing (e.g., JSON, XML, etc.) in some fashion.
We could borrow some of the logic from related strategies but we would
still be stuck having to update `Post` whenever we add a strategy for
a new format.

Instead, this implements `POST` support by borrowing ideas from the
`using: :post` and `data` `url` options found in formulae. This uses
a `post_form` option to handle form data and `post_json` to handle
JSON data, encoding the hash argument for each into the appropriate
format. The presence of either option means that curl will use a
`POST` request.

With this approach, we can make a `POST` request using any strategy
that calls `Strategy::page_headers` or `::page_content` (directly or
indirectly) and everything else works the same as usual. The only
change needed in related strategies was to pass the options through
to the `Strategy` methods.

For example, if we need to parse a JSON response from a `POST`
request, we add a `post_data` or `post_json` hash to the `livecheck`
block `url` and use `strategy :json` with a `strategy` block. This
leans on existing patterns that we're already familiar with and
shouldn't require any notable maintenance burden when adding new
strategies, so it seems like a better approach than a `Post` strategy.
2025-02-07 08:53:47 -05:00
..
2024-03-31 21:46:25 +02:00
2024-06-13 09:55:31 +01:00
2024-06-13 09:55:31 +01:00
2021-12-02 22:58:31 -05:00
2024-06-14 12:22:02 +01:00
2017-01-04 10:53:21 +00:00
2025-02-03 15:30:03 +01:00
2024-06-13 09:55:31 +01:00
2025-02-06 17:03:07 +00:00
2024-06-13 09:55:31 +01:00
2017-07-02 15:09:26 +01:00

last_review_date
last_review_date
1970-01-01

Homebrew Docs

These are the source files for the Homebrew documentation site.

A GitHub Action is run to validate each change before the site is deployed to GitHub Pages.

Usage

Open https://docs.brew.sh in your web browser.

To instead generate the site locally, available on localhost:4000, run:

cd `brew --repository`/docs
bundle install
bundle exec jekyll serve --watch