API Reference

adafruit_fakerequests

Fake Network Requests helper that retrieves data from a local file.

  • Author(s): Melissa LeBlanc-Williams

Implementation Notes

Software and Dependencies:

class adafruit_fakerequests.Fake_Requests(filename: str, headers: dict | None = None, status_code: int = 200)

For faking ‘requests’ using a local file instead of the network.

Parameters:
  • filename (string) – Name of the file to read.

  • headers (dict) – Headers to add to the faked response.

  • status_code (int) – Status code to use to the faked response.

json() Any

json parsed version for local requests.

property text: str

raw text version for local requests.