diff --git a/canvasapi/requester.py b/canvasapi/requester.py
index 2388493..0c09669 100644
--- a/canvasapi/requester.py
+++ b/canvasapi/requester.py
@@ -1,4 +1,5 @@
 from __future__ import absolute_import, division, print_function, unicode_literals
+from datetime import datetime
 
 import requests
 
@@ -58,6 +59,20 @@ class Requester(object):
             auth_header = {'Authorization': 'Bearer %s' % (self.access_token)}
             headers.update(auth_header)
 
+        # Convert kwargs into list of 2-tuples and combine with _kwargs.
+        _kwargs = [] if _kwargs is None else _kwargs
+        for kw, arg, in kwargs.items():
+            _kwargs.append((kw, arg))
+
+        # Do any final argument processing before sending to request method.
+        for i, kwarg in enumerate(_kwargs):
+            kw, arg = kwarg
+
+            # Convert any datetime objects into ISO 8601 formatted strings.
+            if isinstance(arg, datetime):
+                _kwargs[i] = (kw, arg.isoformat())
+
+        # Determine the appropriate request method.
         if method == 'GET':
             req_method = self._get_request
         elif method == 'POST':
@@ -67,13 +82,10 @@ class Requester(object):
         elif method == 'PUT':
             req_method = self._put_request
 
-        # Convert kwargs into list of 2-tuples and combine with _kwargs.
-        _kwargs = [] if _kwargs is None else _kwargs
-        for kw, arg, in kwargs.items():
-            _kwargs.append((kw, arg))
-
+        # Call the request method
         response = req_method(full_url, headers, _kwargs)
 
+        # Raise for status codes
         if response.status_code == 400:
             raise BadRequest(response.json())
         elif response.status_code == 401:

Canvas.list_calendar_events should accept datetime instances
The `Canvas.list_calendar_events` method feeds its parameters down to a `GET /api/v1/calendar_events` request. [That request](https://canvas.instructure.com/doc/api/calendar_events.html#method.calendar_events_api.index) accepts `start_date` and `end_date` parameters, which “should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ.” When using these parameters from Python, it would be convenient to provide values as Python `datetime` instances. For example, to list events between a course’ start and end dates:

```python
from datetime import datetime, timedelta
soon = datetime.today() + timedelta(weeks=2)
events = canvas.list_calendar_events(end_date=soon)
```

This seems like an obvious way to make the call, but iterating over the result fails using version 0.6.0 of `canvasapi`:

```
canvasapi.exceptions.BadRequest: {'end_date': 'Invalid date or invalid datetime for end_date'}'}
```

The call works if I convert the date into a suitably-formatted (ISO 8601) string:

```python
from datetime import datetime, timedelta
soon = datetime.today() + timedelta(weeks=2)
soon_iso = soon.isoformat()
events = canvas.list_calendar_events(end_date=soon_iso)
```

It would be very convenient if `Canvas.list_calendar_events` could accept parameters in the standard `datetime` a Python programmer would naturally expect to use, and would handle the ISO 8601 conversion internally.

Of course, dates and times appear in many other places in the Canvas API. I am reporting this against `Canvas.list_calendar_events` because that is where it is affecting me right now. But perhaps the best fix would be at a lower level within `canvasapi` so that *every* `datetime` instance is converted using `.isoformat` whenever given as the value of any request parameter. Is there a single, centralized place where that could be done?
diff --git a/tests/test_requester.py b/tests/test_requester.py
index 0fabb9f..d65f2d4 100644
--- a/tests/test_requester.py
+++ b/tests/test_requester.py
@@ -1,7 +1,10 @@
 from __future__ import absolute_import, division, print_function, unicode_literals
+from datetime import datetime
 import unittest
 
+import requests
 import requests_mock
+from six.moves.urllib.parse import quote
 
 from canvasapi import Canvas
 from canvasapi.exceptions import (
@@ -26,12 +29,42 @@ class TestRequester(unittest.TestCase):
         response = self.requester.request('GET', 'fake_get_request')
         self.assertEqual(response.status_code, 200)
 
+    def test_request_get_datetime(self, m):
+        date = datetime.today()
+
+        def custom_matcher(request):
+            match_query = 'date={}'.format(quote(date.isoformat()).lower())
+            if request.query == match_query:
+                resp = requests.Response()
+                resp.status_code = 200
+                return resp
+
+        m.add_matcher(custom_matcher)
+
+        response = self.requester.request('GET', 'test', date=date)
+        self.assertEqual(response.status_code, 200)
+
     def test_request_post(self, m):
         register_uris({'requests': ['post']}, m)
 
         response = self.requester.request('POST', 'fake_post_request')
         self.assertEqual(response.status_code, 200)
 
+    def test_request_post_datetime(self, m):
+        date = datetime.today()
+
+        def custom_matcher(request):
+            match_text = 'date={}'.format(quote(date.isoformat()))
+            if request.text == match_text:
+                resp = requests.Response()
+                resp.status_code = 200
+                return resp
+
+        m.add_matcher(custom_matcher)
+
+        response = self.requester.request('POST', 'test', date=date)
+        self.assertEqual(response.status_code, 200)
+
     def test_request_delete(self, m):
         register_uris({'requests': ['delete']}, m)
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
coverage flake8 pyflakes pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
-e git+https://github.com/ucfopen/canvasapi.git@9fd5a6a5dfcbbaae52b9d42752ffee163852b1f9#egg=canvasapi
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
docutils==0.18.1
flake8==5.0.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.7.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
requests-mock==1.12.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: canvasapi
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.18.1
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - requests-mock==1.12.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/canvasapi

tests/test_requester.py::TestRequester::test_request_get_datetime tests/test_requester.py::TestRequester::test_request_post_datetime
tests/test_requester.py::TestRequester::test_request_400 tests/test_requester.py::TestRequester::test_request_401_InvalidAccessToken tests/test_requester.py::TestRequester::test_request_401_Unauthorized tests/test_requester.py::TestRequester::test_request_404 tests/test_requester.py::TestRequester::test_request_500 tests/test_requester.py::TestRequester::test_request_delete tests/test_requester.py::TestRequester::test_request_get tests/test_requester.py::TestRequester::test_request_post tests/test_requester.py::TestRequester::test_request_put
canvasapi/requester.py
canvasapi/requester.py