Normalized HTTP Transport with Circuit Breaking and Caching
Overview
Web service calls return a normalized result value instead of raising a condition, so a caller branches on data rather than on an error handler. Transport failure, a non-success status code, and an unreadable response body are reported as three distinct outcomes. Per-host circuit breaking, retry with a transient-failure predicate, optional throttling, redacted request headers, and a success-only cache come as defaults. Many questions to one source can be asked as a single batch, where only the entries the cache is missing reach the network. Service-specific knowledge is left to the client packages built on top. The circuit breaker is the pattern described in Nygard (2018, ISBN:9781680502398).
Preparation for a first CRAN submission. Everything here came out of reading the
package the way a CRAN reviewer reads one, which is a different pass from the
one that gets a suite green.
Changed
- The disk cache defaults to
tools::R_user_dir("biohttp", "cache")rather thandata/cache. The old default was a relative path, so it resolved against whatever directory R was started in: a job run from two working directories quietly kept two caches, and neither knew about the other. CRAN policy also asks that a package write outsidetempdir()only where a user expects it to, and a directory appearing under the working directory is not that place. Only a caller who had opted into the disk tier withBIOHTTP_CACHE_DISKis affected, and settingBIOHTTP_CACHE_DIRstill overrides it. An existingdata/cacheis not migrated; it is a cache, so the cost of abandoning it is one cold start.
Show all changes in 0.1.2Hide the rest of the changes in 0.1.2
toolsjoinsImportsfor that call. It ships with R, so it adds nothing to what a consumer installs, and it is declared becauseR CMD checkrequires a declaration for anything reached with::.DESCRIPTIONgains a reference for the circuit breaker, names the language asen-US, and hyphenates "service-specific".
Fixed
- Every environment variable the package reads now treats an empty export the same way it treats an absent one.
Sys.getenv()'s default argument only fires when a name is absent, so a container passing through a variable its operator never filled in got""rather than the default, and four readers were doing that.env_num()andenv_flag()had always had the rule;env_chr()gives it to the rest. The one that mattered wasBIOHTTP_CALLER_IDENTITY. Exported empty, it sentUser-Agent: biohttp/0.1.2out as/0.1.2: a version with nothing in front of it, which is the one thing a user agent exists to carry, on a package whose point is being attributable to the service you are calling. Every test in the suite ran that way, becausesetup.Rclears those variables by exporting them empty, and no test looked.BIOHTTP_CACHE_DIRwas the same defect with a smaller blast radius:""as a directory is the working directory, which is what the change above removes.BIOHTTP_CONTACT_URL,BIOHTTP_CONTACT_EMAILandBIOHTTP_CACHE_SALTall default to""anyway, so they read the same as before. - The
status_message()example no longer callswithr, which is inSuggests. An example may only use whatImportsguarantees: CRAN checks with_R_CHECK_DEPENDS_ONLY_set, where aSuggestspackage is simply absent and the example errors. It now sets the option withoptions()and restores it, which also satisfies the separate rule that an example puts back anything it changes.
Added
inst/CITATIONis shipped, socitation("biohttp")carries the Zenodo DOI from an installed copy.CITATION.cffis in.Rbuildignoreand never reached a tarball, so the README had been promising something only a source checkout could deliver. Both exist now, because GitHub's cite box reads the.cffand R readsinst/CITATION.
Documentation
- The README linked to
CONTRIBUTING.mdandLICENSE.mdby relative path. Both are in.Rbuildignore, so neither reaches a tarball and both links were dead for anyone reading the README somewhere other than GitHub, which from here includes the CRAN package page. They are absolute now. - The README's
Importslist named five packages whereDESCRIPTIONnames six. A README that contradicts theDESCRIPTIONprinted beside it on the CRAN page is worth more than the line it saves. - The status line no longer carries a version number. The last one went stale within a release of being written, and
NEWS.mdalready answers the question.
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK7 OK2026-09-04
Documentation
- Help pages
- 32 (1 internal)includes a package overview page
- Examples that run
- 100%30 run in a plain check
- Exported functions with examples
- 97%
- Documented parameters
- 97%
- Return-value docs
- 97%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 98%
- Median days to close, 50 most recently updated closed issues
- 0
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
PRs over time
Commits over time
Commit identities over time
17 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/samuelbharti/biohttp on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-16 · The repository has a site deploy workflow
Show all practicesHide 3 practices
Dependencies
Installing biohttp adds 16 packages (12 with compiled code, 6.2 MB of source tarballs). Heaviest: openssl 1.1 MB, jsonlite 1.0 MB, vctrs 1.0 MB.
Code & Tests
People & History
- 0.1.2Latest2026-09-03 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-09-03
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.0
- Download size
- 100 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("biohttp")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.