Page 1 of 1

Request Parameter Validation Suppose you are working on a task management application that serves the frontend app on An

Posted: Sat Feb 19, 2022 3:22 pm
by answerhappygod
Request Parameter Validation
Suppose you are working on a task management application that
serves the frontend app on Android and iOS phones. You are working
on designing a new API to get all tasks, but this API will be
supported only for Android and not on iOS to start with. To handle
this condition, you have decided to add a query parameter called
the ‘osType’ which represents the user's operating system. The API
definition looks like this:
Which of the following basic validations should be performed for
the value of the ‘osType’ parameter before passing the request to
the service layer for processing?
Note: "More than one option may be
correct".
1) Ensure that it is not null
2) Ensure that it is an integer
3) Ensure that it is not an empty string
4) Check if it is not present in the database


Please Give Right Solution.