A developer has implemented a custom API using Firebase Cloud Functions to serve specific data. This API is designed to handle GET requests for public data. A security audit flags a concern about how the API handles unsupported HTTP methods, such as a PUT request. According to best practices for API security and error handling, which response is the most appropriate when a PUT request is received at this GET-only endpoint?Single choice

A
a. Return a 500 Internal Server Error, as an unexpected request method indicates a server-side problem.
B
b. Return a 200 OK status with an empty response body, as no data was modified.
C
c. Return a 405 Method Not Allowed status, explicitly indicating that the PUT method is not supported.
D
d. Return a 404 Not Found status, to avoid exposing internal logic about supported methods to potential attackers.
Log in for full answers
We've collected over 50,000 authentic original questions and detailed explanations from around the globe. Log in now and get instant access to the answers!
Similar Questions
Question15 Which one of the following REST methods is NOT idempotent? HTTP PUT HTTP HEAD HTTP POST HTTP GET ResetMaximum marks: 0.5 Flag question undefined
A GET request transmits form data ________, while a POST request transmits form data in ________.
The HTTP method used to update an existing resource in REST is:
Which HTTP method is typically used for retrieving data in RESTful services?
More Practical Tools for Students Powered by AI Study Helper
Making Your Study Simpler
Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!