{
  "_id": "6a10567facfb0bcc41ca2b1d",
  "Package": "httptest2",
  "Type": "Package",
  "Title": "Test Helpers for 'httr2'",
  "Description": "Testing and documenting code that communicates with remote\nservers can be painful. This package helps with writing tests\nfor packages that use 'httr2'. It enables testing all of the\nlogic on the R sides of the API without requiring access to the\nremote service, and it also allows recording real API responses\nto use as test fixtures. The ability to save responses and load\nthem offline also enables writing vignettes and other dynamic\ndocuments that can be distributed without access to a live\nserver.",
  "Version": "1.2.2",
  "Authors@R": "c(\nperson(\"Neal\", \"Richardson\", role=c(\"aut\", \"cre\"), email=\"neal.p.richardson@gmail.com\", comment=c(ORCID=\"0009-0002-7992-3520\")),\nperson(\"Jonathan\", \"Keane\", role=\"ctb\", email=\"jkeane@gmail.com\"),\nperson(\"Maëlle\", \"Salmon\", role=\"ctb\", email=\"maelle.salmon@yahoo.se\", comment=c(ORCID=\"0000-0002-2815-0399\"))\n)",
  "URL": "https://enpiar.com/httptest2/,\nhttps://github.com/nealrichardson/httptest2",
  "BugReports": "https://github.com/nealrichardson/httptest2/issues",
  "License": "MIT + file LICENSE",
  "Language": "en-US",
  "RoxygenNote": "7.3.3",
  "Roxygen": "list(markdown = TRUE)",
  "Encoding": "UTF-8",
  "VignetteBuilder": "knitr",
  "Config/testthat/edition": "3",
  "Config/pak/sysreqs": "cmake make libuv1-dev libssl-dev",
  "Repository": "https://nealrichardson.r-universe.dev",
  "Date/Publication": "2025-11-16 20:29:54 UTC",
  "RemoteUrl": "https://github.com/nealrichardson/httptest2",
  "RemoteRef": "HEAD",
  "RemoteSha": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-05-09 07:41:17 UTC",
    "User": "root"
  },
  "Author": "Neal Richardson [aut, cre] (ORCID:\n<https://orcid.org/0009-0002-7992-3520>),\nJonathan Keane [ctb],\nMaëlle Salmon [ctb] (ORCID: <https://orcid.org/0000-0002-2815-0399>)",
  "Maintainer": "Neal Richardson <neal.p.richardson@gmail.com>",
  "MD5sum": "51cc683cfbedb5d8fad202f9849e71ad",
  "_user": "nealrichardson",
  "_type": "src",
  "_file": "httptest2_1.2.2.tar.gz",
  "_fileid": "6c05dcf12c945c9143f94dfd34d08120a425ef3c5e5146a4fa0c267a656af309",
  "_filesize": 221930,
  "_sha256": "6c05dcf12c945c9143f94dfd34d08120a425ef3c5e5146a4fa0c267a656af309",
  "_created": "2026-05-09T07:41:17.000Z",
  "_published": "2026-05-22T13:13:35.692Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 77386631007,
      "time": 137,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "6894065201"
    },
    {
      "job": 77386630909,
      "time": 137,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6894065218"
    },
    {
      "job": 77386630969,
      "time": 152,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "6894065962"
    },
    {
      "job": 77386631029,
      "time": 77,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6894058588"
    },
    {
      "job": 77386630557,
      "time": 177,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6894049733"
    },
    {
      "job": 77386630518,
      "time": 107,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7161359034"
    },
    {
      "job": 77386630911,
      "time": 96,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "6894060420"
    },
    {
      "job": 77386631532,
      "time": 88,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "6894059768"
    },
    {
      "job": 77386630907,
      "time": 106,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6894061484"
    }
  ],
  "_buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/nealrichardson/httptest2",
  "_commit": {
    "id": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
    "author": "Neal Richardson <neal.p.richardson@gmail.com>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Prep for release 1.2.2 (#61)\n\n",
    "time": 1763324994
  },
  "_maintainer": {
    "name": "Neal Richardson",
    "email": "neal.p.richardson@gmail.com",
    "login": "nealrichardson",
    "twitter": "@enpiar",
    "uuid": 2975928
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "digest",
      "role": "Imports"
    },
    {
      "package": "httr2",
      "version": ">= 0.2.0",
      "role": "Imports"
    },
    {
      "package": "jsonlite",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "testthat",
      "version": ">= 3.1.5",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "curl",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "pkgload",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "spelling",
      "role": "Suggests"
    },
    {
      "package": "webfakes",
      "role": "Suggests"
    },
    {
      "package": "xml2",
      "role": "Suggests"
    }
  ],
  "_owner": "nealrichardson",
  "_selfowned": true,
  "_usedby": 1,
  "_updates": [
    {
      "week": "2025-25",
      "n": 1
    },
    {
      "week": "2025-26",
      "n": 2
    },
    {
      "week": "2025-28",
      "n": 1
    },
    {
      "week": "2025-30",
      "n": 3
    },
    {
      "week": "2025-46",
      "n": 3
    }
  ],
  "_tags": [
    {
      "name": "1.2.0",
      "date": "2025-06-27"
    },
    {
      "name": "1.2.1",
      "date": "2025-07-27"
    },
    {
      "name": "1.2.2",
      "date": "2025-11-16"
    }
  ],
  "_topics": [
    "http",
    "mock",
    "testing"
  ],
  "_stars": 36,
  "_contributors": [
    {
      "user": "nealrichardson",
      "count": 280,
      "uuid": 2975928
    },
    {
      "user": "byapparov",
      "count": 7,
      "uuid": 1449277
    },
    {
      "user": "maelle",
      "count": 5,
      "uuid": 8360597
    },
    {
      "user": "jonkeane",
      "count": 4,
      "uuid": 700357
    },
    {
      "user": "hadley",
      "count": 3,
      "uuid": 4196
    },
    {
      "user": "jmaspons",
      "count": 2,
      "uuid": 102644
    },
    {
      "user": "dmenne",
      "count": 1,
      "uuid": 506275
    },
    {
      "user": "kforner",
      "count": 1,
      "uuid": 122744
    },
    {
      "user": "lionel-",
      "count": 1,
      "uuid": 4465050
    },
    {
      "user": "brooklynbagel",
      "count": 1,
      "uuid": 7762865
    },
    {
      "user": "natbprice",
      "count": 1,
      "uuid": 4807431
    },
    {
      "user": "exetico",
      "count": 1,
      "uuid": 3549445
    }
  ],
  "_userbio": {
    "uuid": 2975928,
    "type": "user",
    "name": "Neal Richardson"
  },
  "_downloads": {
    "count": 6870,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/httptest2"
  },
  "_devurl": "https://github.com/nealrichardson/httptest2",
  "_pkgdown": "https://enpiar.com/httptest2/",
  "_searchresults": 165,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/httptest2.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/nealrichardson/httptest2",
  "_realowner": "nealrichardson",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2022-01-10"
    },
    {
      "version": "1.0.0",
      "date": "2023-11-07"
    },
    {
      "version": "1.1.0",
      "date": "2024-04-26"
    },
    {
      "version": "1.2.0",
      "date": "2025-06-27"
    },
    {
      "version": "1.2.1",
      "date": "2025-08-01"
    },
    {
      "version": "1.2.2",
      "date": "2025-11-16"
    }
  ],
  "_exports": [
    ".mockPaths",
    "block_requests",
    "build_mock_url",
    "capture_requests",
    "change_state",
    "end_vignette",
    "expect_DELETE",
    "expect_GET",
    "expect_no_request",
    "expect_PATCH",
    "expect_POST",
    "expect_PUT",
    "expect_request_header",
    "find_mock_file",
    "get_current_redactor",
    "gsub_response",
    "redact_cookies",
    "redact_headers",
    "save_response",
    "set_redactor",
    "start_capturing",
    "start_vignette",
    "stop_capturing",
    "stop_mocking",
    "use_httptest2",
    "use_mock_api",
    "with_mock_api",
    "with_mock_dir",
    "with_trace",
    "within_body_text",
    "without_internet"
  ],
  "_help": [
    {
      "page": "mockPaths",
      "title": "Set an alternate directory for mock API fixtures",
      "topics": [
        ".mockPaths"
      ]
    },
    {
      "page": "capture_requests",
      "title": "Record API responses as mock files",
      "topics": [
        "capture_requests",
        "start_capturing",
        "stop_capturing"
      ]
    },
    {
      "page": "change_state",
      "title": "Handle a change of server state",
      "topics": [
        "change_state"
      ]
    },
    {
      "page": "expect_request_header",
      "title": "Test that an HTTP request is made with a header",
      "topics": [
        "expect_request_header"
      ]
    },
    {
      "page": "expect_verb",
      "title": "Expectations for mocked HTTP requests",
      "topics": [
        "expect_DELETE",
        "expect_GET",
        "expect_no_request",
        "expect_PATCH",
        "expect_POST",
        "expect_PUT",
        "expect_verb"
      ]
    },
    {
      "page": "gsub_response",
      "title": "Find and replace within a response object",
      "topics": [
        "gsub_response"
      ]
    },
    {
      "page": "redact",
      "title": "Remove sensitive content from HTTP responses",
      "topics": [
        "redact",
        "redact_cookies",
        "redact_headers",
        "within_body_text"
      ]
    },
    {
      "page": "set_redactor",
      "title": "Set a response redactor",
      "topics": [
        "set_redactor"
      ]
    },
    {
      "page": "start_vignette",
      "title": "Set mocking/capturing state for a vignette",
      "topics": [
        "end_vignette",
        "start_vignette"
      ]
    },
    {
      "page": "use_httptest2",
      "title": "Use 'httptest2' in your tests",
      "topics": [
        "use_httptest2"
      ]
    },
    {
      "page": "with_mock_api",
      "title": "Serve a mock API from files",
      "topics": [
        "stop_mocking",
        "use_mock_api",
        "with_mock_api"
      ]
    },
    {
      "page": "with_mock_dir",
      "title": "Use or create mock files depending on their existence",
      "topics": [
        "with_mock_dir"
      ]
    },
    {
      "page": "without_internet",
      "title": "Make all HTTP requests raise an error",
      "topics": [
        "block_requests",
        "without_internet"
      ]
    }
  ],
  "_readme": "https://github.com/nealrichardson/httptest2/raw/HEAD/README.md",
  "_rundeps": [
    "askpass",
    "brio",
    "callr",
    "cli",
    "crayon",
    "curl",
    "desc",
    "diffobj",
    "digest",
    "evaluate",
    "fs",
    "glue",
    "httr2",
    "jsonlite",
    "lifecycle",
    "magrittr",
    "openssl",
    "pkgbuild",
    "pkgload",
    "praise",
    "processx",
    "ps",
    "R6",
    "rappdirs",
    "rlang",
    "rprojroot",
    "sys",
    "testthat",
    "vctrs",
    "waldo",
    "withr"
  ],
  "_vignettes": [
    {
      "source": "faq.Rmd",
      "filename": "faq.html",
      "title": "Frequently Asked Questions",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Where are my mocks recorded?",
        "How do I fix \"non-portable file paths\"?",
        "Why are mocks stored as text files?"
      ],
      "created": "2020-12-15 00:06:40",
      "modified": "2023-07-06 17:01:09",
      "commits": 5
    },
    {
      "source": "httptest2.Rmd",
      "filename": "httptest2.html",
      "title": "httptest: A Test Environment for HTTP Requests in R",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Getting started",
        "Basic tests from a live server",
        "Going deeper"
      ],
      "created": "2021-12-29 13:44:20",
      "modified": "2025-06-27 19:09:37",
      "commits": 5
    },
    {
      "source": "redacting.Rmd",
      "filename": "redacting.html",
      "title": "Redacting and Modifying Recorded Requests",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Default: redact standard auth methods",
        "Writing custom redacting functions",
        "Setting a package-level redactor",
        "URL shortening"
      ],
      "created": "2017-10-08 21:42:19",
      "modified": "2025-06-27 19:09:37",
      "commits": 20
    },
    {
      "source": "vignettes.Rmd",
      "filename": "vignettes.html",
      "title": "Writing Vignettes with APIs",
      "engine": "knitr::rmarkdown",
      "headings": [
        "The basics: start_vignette()",
        "Handling server state changes",
        "Advanced topics"
      ],
      "created": "2018-01-12 06:00:09",
      "modified": "2025-06-27 19:09:37",
      "commits": 10
    }
  ],
  "_score": 10.12925712191863,
  "_indexed": true,
  "_nocasepkg": "httptest2",
  "_universes": [
    "nealrichardson"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.2.2",
      "date": "2026-05-09T07:43:30.000Z",
      "distro": "noble",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "764c1ecd872ce18efacdc77eafe86deff08f6519efc28926ee0924d5666167d2",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.2.2",
      "date": "2026-05-09T07:43:31.000Z",
      "distro": "noble",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "2bcebe0cc943df28df56d7f14565222e8da5a0015f8fe4e22448471b56d1d694",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.2.2",
      "date": "2026-05-09T07:43:31.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "6dd9fab64fe2437a1c0a07ab99be2a6c3001f6bcd0916dd09d666f03caf2a458",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.2.2",
      "date": "2026-05-09T07:42:35.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "5d25972efb8185fbfa9c262aecf06d488eb20fad7eb40c70eff43ad2bf1ecd02",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.2.2",
      "date": "2026-05-09T07:42:39.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "04a7dbb147e4a3b28ca2177bdcc8ead798d667179fff650f15d87be0445f15f8",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.2.2",
      "date": "2026-05-09T07:42:31.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "ef727561c668cc665dc58b6533d8c0e219459d8ff0814ef4e6a873815c77d8b6",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.2.2",
      "date": "2026-05-09T07:42:51.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "adcf6cda463591cfb4ed22d45c8880a82703cd97e3740dbd625f6676c849e747",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.2.2",
      "date": "2026-05-22T13:13:13.000Z",
      "commit": "5e4a8d3b4d634e8df637092a03906e83ebba41bf",
      "fileid": "62cd5117c1112cea3fee2add12e9cfafca57e8128524bc6f30598468372ebeba",
      "status": "success",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25595531501"
    }
  ]
}