=======================
API Key Example
=======================
Running:
.. code-block:: bash
$ pip install --upgrade connexion[swagger-ui] # install Connexion from PyPI
$ uvicorn app:app
Now open your browser and go to http://localhost:8080/openapi/ui/ or
http://localhost:8080/swagger/ui/ to see the Swagger UI.
The hardcoded apikey is `asdf1234567890`.
Test it out (in another terminal):
.. code-block:: bash
$ curl -H 'X-Auth: asdf1234567890' http://localhost:8080/openapi/secret
$ curl -H 'X-Auth: asdf1234567890' http://localhost:8080/swagger/secret
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Python
73.6%
HTML
26.4%
=======================
API Key Example
=======================
Running:
.. code-block:: bash
$ pip install --upgrade connexion[swagger-ui] # install Connexion from PyPI
$ uvicorn app:app
Now open your browser and go to http://localhost:8080/openapi/ui/ or
http://localhost:8080/swagger/ui/ to see the Swagger UI.
The hardcoded apikey is `asdf1234567890`.
Test it out (in another terminal):
.. code-block:: bash
$ curl -H 'X-Auth: asdf1234567890' http://localhost:8080/openapi/secret
$ curl -H 'X-Auth: asdf1234567890' http://localhost:8080/swagger/secret
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Python
73.6%
HTML
26.4%