26. In Express, app.use(express.json()) is needed to:
- Send HTML
- Connect to MySQL
- Parse JSON request bodies into req.body
- Start HTTPS
Answer: C) Parse JSON request bodies into req.body
Explanation: The JSON middleware parses incoming JSON.
MCQs / Computer Science / Web Services: Accessing and Creating
35 multiple-choice questions on Web Services: Accessing and Creating from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
Answer: C) Parse JSON request bodies into req.body
Explanation: The JSON middleware parses incoming JSON.
Answer: C) JSON Web Token
Explanation: JWTs are signed JSON tokens used for authentication.
Answer: B) Each request contains all information needed; the server stores no client session between requests
Explanation: Statelessness makes REST scalable.
Answer: A) SQL injection
Explanation: Parameters are sent separately from the SQL command.
Answer: D) In the 200–299 range
Explanation: isSuccessful is true for 2xx codes.
Answer: B) HTTP method
Explanation: -X sets the request method.
Answer: C) XML
Explanation: SOAP uses XML envelopes.
Answer: D) WSDL
Explanation: Web Services Description Language describes SOAP operations.
Answer: A) GET /api/students
Explanation: Use plural nouns for resources and HTTP methods for actions.
Answer: A) Route / controller
Explanation: Routes/controllers map URLs to handler code.
Previous Page 2 of 2
Practise Web Services: Accessing and Creating MCQs