{
  "_id": "6a1f3265b401979e73427f03",
  "Package": "httptest",
  "Type": "Package",
  "Title": "A Test Environment for HTTP Requests",
  "Description": "Testing and documenting code that communicates with remote\nservers can be painful. Dealing with authentication, server\nstate, and other complications can make testing seem too costly\nto bother with. But it doesn't need to be that hard. This\npackage enables one to test all of the logic on the R sides of\nthe API in your package without requiring access to the remote\nservice. Importantly, it provides three contexts that mock the\nnetwork connection in different ways, as well as testing\nfunctions to assert that HTTP requests were---or were\nnot---made. It also allows one to safely record real API\nresponses to use as test fixtures. The ability to save\nresponses and load them offline also enables one to write\nvignettes and other dynamic documents that can be distributed\nwithout access to a live server.",
  "Version": "4.2.3",
  "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/r/httptest/,\nhttps://github.com/nealrichardson/httptest",
  "BugReports": "https://github.com/nealrichardson/httptest/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/Needs/coverage": "covr",
  "Config/pak/sysreqs": "cmake make libuv1-dev libssl-dev",
  "Repository": "https://nealrichardson.r-universe.dev",
  "Date/Publication": "2025-11-16 18:16:31 UTC",
  "RemoteUrl": "https://github.com/nealrichardson/httptest",
  "RemoteRef": "HEAD",
  "RemoteSha": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-05-15 07:39:08 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": "d3b9f52128323f5e75f9f20000ade814",
  "_user": "nealrichardson",
  "_type": "src",
  "_file": "httptest_4.2.3.tar.gz",
  "_fileid": "ad35f566122aac1640d362a6c409c967b71172d6144bd24b5588233badaa3ccb",
  "_filesize": 281457,
  "_sha256": "ad35f566122aac1640d362a6c409c967b71172d6144bd24b5588233badaa3ccb",
  "_created": "2026-05-15T07:39:08.000Z",
  "_published": "2026-06-02T19:43:33.498Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 79157324400,
      "time": 135,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7012436639"
    },
    {
      "job": 79157324437,
      "time": 129,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7012435216"
    },
    {
      "job": 79157324462,
      "time": 107,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7012428930"
    },
    {
      "job": 79157324602,
      "time": 116,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7012431855"
    },
    {
      "job": 79157323717,
      "time": 162,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7012400265"
    },
    {
      "job": 79157323975,
      "time": 110,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7368075827"
    },
    {
      "job": 79157324577,
      "time": 85,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7012423978"
    },
    {
      "job": 79157324900,
      "time": 83,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7012422852"
    },
    {
      "job": 79157324449,
      "time": 89,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7012424428"
    }
  ],
  "_buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/nealrichardson/httptest",
  "_commit": {
    "id": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
    "author": "Neal Richardson <neal.p.richardson@gmail.com>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Release 4.2.3 (#93)\n\n",
    "time": 1763316991
  },
  "_maintainer": {
    "name": "Neal Richardson",
    "email": "neal.p.richardson@gmail.com",
    "login": "nealrichardson",
    "twitter": "@enpiar",
    "uuid": 2975928
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "testthat",
      "role": "Depends"
    },
    {
      "package": "curl",
      "role": "Imports"
    },
    {
      "package": "digest",
      "role": "Imports"
    },
    {
      "package": "httr",
      "role": "Imports"
    },
    {
      "package": "jsonlite",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "pkgload",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "spelling",
      "role": "Suggests"
    },
    {
      "package": "xml2",
      "role": "Suggests"
    }
  ],
  "_owner": "nealrichardson",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-41",
      "n": 5
    },
    {
      "week": "2025-46",
      "n": 1
    }
  ],
  "_tags": [
    {
      "name": "4.2.3",
      "date": "2025-11-16"
    }
  ],
  "_topics": [
    "http",
    "mock",
    "test-framework"
  ],
  "_stars": 83,
  "_contributors": [
    {
      "user": "nealrichardson",
      "count": 227,
      "uuid": 2975928
    },
    {
      "user": "byapparov",
      "count": 7,
      "uuid": 1449277
    },
    {
      "user": "maelle",
      "count": 6,
      "uuid": 8360597
    },
    {
      "user": "jonkeane",
      "count": 4,
      "uuid": 700357
    },
    {
      "user": "kforner",
      "count": 2,
      "uuid": 122744
    },
    {
      "user": "dmenne",
      "count": 1,
      "uuid": 506275
    },
    {
      "user": "erdaradungaztea",
      "count": 1,
      "uuid": 32573962
    },
    {
      "user": "hadley",
      "count": 1,
      "uuid": 4196
    },
    {
      "user": "lionel-",
      "count": 1,
      "uuid": 4465050
    },
    {
      "user": "brooklynbagel",
      "count": 1,
      "uuid": 7762865
    },
    {
      "user": "natbprice",
      "count": 1,
      "uuid": 4807431
    },
    {
      "user": "stephenashton-dhsc",
      "count": 1,
      "uuid": 66256552
    }
  ],
  "_userbio": {
    "uuid": 2975928,
    "type": "user",
    "name": "Neal Richardson"
  },
  "_downloads": {
    "count": 4527,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/httptest"
  },
  "_devurl": "https://github.com/nealrichardson/httptest",
  "_pkgdown": "https://enpiar.com/r/httptest/",
  "_searchresults": 337,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/httptest.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/nealrichardson/httptest",
  "_realowner": "nealrichardson",
  "_cranurl": true,
  "_releases": [
    {
      "version": "1.0.0",
      "date": "2016-12-31"
    },
    {
      "version": "1.1.0",
      "date": "2017-02-03"
    },
    {
      "version": "1.2.0",
      "date": "2017-03-22"
    },
    {
      "version": "1.3.0",
      "date": "2017-04-13"
    },
    {
      "version": "2.0.0",
      "date": "2017-06-05"
    },
    {
      "version": "2.1.0",
      "date": "2017-07-31"
    },
    {
      "version": "2.1.2",
      "date": "2017-08-04"
    },
    {
      "version": "2.3.2",
      "date": "2017-10-20"
    },
    {
      "version": "2.3.4",
      "date": "2017-11-14"
    },
    {
      "version": "3.0.0",
      "date": "2018-01-16"
    },
    {
      "version": "3.1.0",
      "date": "2018-06-19"
    },
    {
      "version": "3.2.0",
      "date": "2018-11-09"
    },
    {
      "version": "3.2.2",
      "date": "2018-12-07"
    },
    {
      "version": "3.3.0",
      "date": "2020-01-28"
    },
    {
      "version": "4.0.0",
      "date": "2021-02-01"
    },
    {
      "version": "4.1.0",
      "date": "2021-09-22"
    },
    {
      "version": "4.2.0",
      "date": "2023-05-29"
    },
    {
      "version": "4.2.1",
      "date": "2023-06-12"
    },
    {
      "version": "4.2.2",
      "date": "2024-01-23"
    },
    {
      "version": "4.2.3",
      "date": "2025-11-15"
    }
  ],
  "_exports": [
    ".mockPaths",
    "block_requests",
    "build_mock_url",
    "capture_requests",
    "change_state",
    "end_vignette",
    "expect_DELETE",
    "expect_GET",
    "expect_header",
    "expect_json_equivalent",
    "expect_no_request",
    "expect_PATCH",
    "expect_POST",
    "expect_PUT",
    "fake_response",
    "find_mock_file",
    "get_current_redactor",
    "get_current_requester",
    "gsub_request",
    "gsub_response",
    "public",
    "redact_auth",
    "redact_cookies",
    "redact_headers",
    "save_response",
    "set_redactor",
    "set_requester",
    "skip_if_disconnected",
    "start_capturing",
    "start_vignette",
    "stop_capturing",
    "stop_mocking",
    "use_httptest",
    "use_mock_api",
    "with_fake_http",
    "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": "block_requests",
      "title": "Block HTTP requests",
      "topics": [
        "block_requests"
      ]
    },
    {
      "page": "build_mock_url",
      "title": "Convert a request to a mock file path",
      "topics": [
        "build_mock_url"
      ]
    },
    {
      "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_header",
      "title": "Test that an HTTP request is made with a header",
      "topics": [
        "expect_header"
      ]
    },
    {
      "page": "expect_json_equivalent",
      "title": "Test that objects would generate equivalent JSON",
      "topics": [
        "expect_json_equivalent"
      ]
    },
    {
      "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": "fake_response",
      "title": "Return something that looks like a 'response'",
      "topics": [
        "fake_response"
      ]
    },
    {
      "page": "gsub_response",
      "title": "Find and replace within a 'response' or 'request'",
      "topics": [
        "gsub_request",
        "gsub_response"
      ]
    },
    {
      "page": "httptest",
      "title": "'httptest': A Test Environment for HTTP Requests",
      "topics": [
        "httptest-package",
        "httptest"
      ]
    },
    {
      "page": "public",
      "title": "Test that functions are exported",
      "topics": [
        "public"
      ]
    },
    {
      "page": "redact",
      "title": "Remove sensitive content from HTTP responses",
      "topics": [
        "redact",
        "redact_auth",
        "redact_cookies",
        "redact_headers",
        "within_body_text"
      ]
    },
    {
      "page": "set_redactor",
      "title": "Set a response redactor",
      "topics": [
        "set_redactor"
      ]
    },
    {
      "page": "set_requester",
      "title": "Set a request preprocessor",
      "topics": [
        "set_requester"
      ]
    },
    {
      "page": "skip_if_disconnected",
      "title": "Skip tests that need an internet connection if you don't have one",
      "topics": [
        "skip_if_disconnected"
      ]
    },
    {
      "page": "start_vignette",
      "title": "Set mocking/capturing state for a vignette",
      "topics": [
        "end_vignette",
        "start_vignette"
      ]
    },
    {
      "page": "stop_mocking",
      "title": "Turn off request mocking",
      "topics": [
        "stop_mocking"
      ]
    },
    {
      "page": "use_httptest",
      "title": "Use 'httptest' in your tests",
      "topics": [
        "use_httptest"
      ]
    },
    {
      "page": "use_mock_api",
      "title": "Turn on API mocking",
      "topics": [
        "use_mock_api"
      ]
    },
    {
      "page": "with_fake_http",
      "title": "Make all HTTP requests return a fake response",
      "topics": [
        "with_fake_http"
      ]
    },
    {
      "page": "with_mock_api",
      "title": "Serve a mock API from files",
      "topics": [
        "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": [
        "without_internet"
      ]
    }
  ],
  "_readme": "https://github.com/nealrichardson/httptest/raw/HEAD/README.md",
  "_rundeps": [
    "askpass",
    "brio",
    "callr",
    "cli",
    "crayon",
    "curl",
    "desc",
    "diffobj",
    "digest",
    "evaluate",
    "fs",
    "glue",
    "httr",
    "jsonlite",
    "lifecycle",
    "magrittr",
    "mime",
    "openssl",
    "pkgbuild",
    "pkgload",
    "praise",
    "processx",
    "ps",
    "R6",
    "rlang",
    "rprojroot",
    "sys",
    "testthat",
    "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\"?",
        "How do I switch between mocking and real requests?"
      ],
      "created": "2020-12-15 00:06:40",
      "modified": "2025-11-16 18:16:31",
      "commits": 2
    },
    {
      "source": "httptest.Rmd",
      "filename": "httptest.html",
      "title": "httptest: A Test Environment for HTTP Requests in R",
      "engine": "knitr::rmarkdown",
      "headings": [
        "The with_mock_api context",
        "Example",
        "Recording mocks with capture_requests",
        "Automatically recording/playing back: the with_mock_dir() context",
        "Mocks are text files",
        "Testing that requests aren't made",
        "Assert the shape of request payloads",
        "Just test it"
      ],
      "created": "2017-06-01 06:41:17",
      "modified": "2025-11-16 18:16:31",
      "commits": 22
    },
    {
      "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",
        "Request preprocessing"
      ],
      "created": "2017-10-08 21:42:19",
      "modified": "2025-11-16 18:16:31",
      "commits": 19
    },
    {
      "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-11-16 18:16:31",
      "commits": 9
    }
  ],
  "_score": 9.745971164228852,
  "_indexed": true,
  "_nocasepkg": "httptest",
  "_universes": [
    "nealrichardson"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "4.2.3",
      "date": "2026-05-15T07:41:15.000Z",
      "distro": "noble",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "59114d7718840445ee7b98e44e7730038a8067ede6efdea7027eca6b9c9aa87c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "4.2.3",
      "date": "2026-05-15T07:41:11.000Z",
      "distro": "noble",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "5954f2903218ec20bd25bce36b4fd5d9400900a4a2689575152b733dba89e6af",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "4.2.3",
      "date": "2026-05-15T07:40:48.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "a79532861a872a1ebe48ccb50967694864a08cc6b4c0ad2a8491ad5e4c886662",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "4.2.3",
      "date": "2026-05-15T07:41:00.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "0947a9830211da066d38d568029c16442595f0291865766f0bbdb7f3f657f014",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "4.2.3",
      "date": "2026-05-15T07:40:22.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "254f63945300d68672a39b05117955bcfa79e779b8ee10a785f6a8df8c65a489",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "4.2.3",
      "date": "2026-05-15T07:40:19.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "1de2565c78b9c43b398ca15c99c0402fbaa2002e736819150b3e0e87ac7e86c5",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "4.2.3",
      "date": "2026-05-15T07:40:21.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "836825609e51f5636158ce308e756a6d30b164a5f1c7d18cd8dbfce15edd1147",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "4.2.3",
      "date": "2026-06-02T19:43:16.000Z",
      "commit": "97b186987c97f811b8c22fa91744f1b60c3c41f0",
      "fileid": "a134fa21e876cc7c8cc5aca3111b3135be926eb7a42e4db9fb25d140209baadc",
      "status": "success",
      "buildurl": "https://github.com/r-universe/nealrichardson/actions/runs/25906341253"
    }
  ]
}