Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • F FastAPI
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Sitemule
  • Public
  • workshops
  • open source on IBM i
  • FastAPI
  • Wiki
  • Part 2a. Extending my first service

Part 2a. Extending my first service · Changes

Page history
Update Part 2a. Extending my first service authored Oct 30, 2021 by Jens Melgard Churchill's avatar Jens Melgard Churchill
Hide whitespace changes
Inline Side-by-side
Part-2a.-Extending-my-first-service.md
View page @ 137f4d91
......@@ -60,7 +60,6 @@ async def add_process_time_header(request: Request, call_next):
response.headers["X-Process-Time"] = str(process_time)
return response
```
Exit _insert-mode_ by pressing `Esc`, and save the file using `:w`
......@@ -75,4 +74,25 @@ _For the impatient out there, the issue can be forced by pressing **F5** in vim.
![image](uploads/6a5a9100d676b68fdd9833d5ef578d98/image.png)
Now we can time the time spent processing the incoming requests, sweet!
\ No newline at end of file
Now we can time the time spent processing the incoming requests, sweet!
## But, timing isn't everything ![image](uploads/764633829cc182157688821ff3a88bbb/image.png)
We can even test our API using the browser...\
While you where busy coding, FastAPI was busy documenting that code using the OpenAPI standard...
Try navigating to [https://fastapi.ibmi.rocks/{id}/docs](https://fastapi.ibmi.rocks/%7Bid%7D/docs) - where `{id}` is the number assigned to you from earlier.
![image](uploads/a8190c5331707079f914a34bede74d9f/image.png)
The input arguments are documented as being required, and what type they are expecting,
Filling out the input fields, and pressing "Execute" yields some useful information...
![image](uploads/1c296e8f8aa8ca996447d0a7e8a2d130/image.png)
Going further down the page, all kinds of things are described, different sort of responses and status codes, and all the data models available, but we aren't there yet.
Clapping is allowed!
[Proceed to the next page...](Part-2b.-Organise-my-first-service)
\ No newline at end of file
Clone repository
  • Part 1a. My first service
  • Part 1b. Testing my first service
  • Part 2a. Extending my first service
  • Part 2b. Organise my first service
  • Part 3a. Review my first service
  • Part 3b. Connecting my first service
  • Home