You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/ivoa.rst
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,29 @@ IVOA protocol support
5
5
The IVOA web protocols aren't entirely RESTful and have some unusual requirements that are not provided by modern web frameworks.
6
6
Safir provides some FastAPI support facilities to make implementing IVOA services easier.
7
7
8
-
Query parameter case insensitivity
9
-
==================================
8
+
Parameter case insensitivity
9
+
============================
10
10
11
11
Many IVOA protocols require the key of a query parameter to be case-insensitive.
12
12
For example, the requests ``GET /api/foo?param=bar`` and ``GET /api/foo?PARAM=bar`` are supposed to produce identical results.
13
-
Safir provides `safir.middleware.ivoa.CaseInsensitiveQueryMiddleware` to implement this protocol requirement.
13
+
The same is true for parameters provided in form bodies to ``POST``.
14
14
15
-
Add this middleware to the FastAPI application:
15
+
Safir provides two middlewares, `~safir.middleware.ivoa.CaseInsensitiveQueryMiddleware` and `~safir.middleware.ivoa.CaseInsensitiveFormMiddleware`, to implement this protocol requirement.
16
+
17
+
Add these middlewares to the FastAPI application:
16
18
17
19
.. code-block:: python
18
20
19
-
from safir.middleware.ivoa import CaseInsensitiveQueryMiddleware
0 commit comments