Which JSON key correctly specifies the HTTP method used by an API endpoint?
easy📝 Syntax Q3 of 15
Rest API - API Documentation
Which JSON key correctly specifies the HTTP method used by an API endpoint?
A"httpMethod": "GET"
B"type": "PUT"
C"action": "DELETE"
D"method": "POST"
Step-by-Step Solution
Solution:
Step 1: Identify the standard key for HTTP method
In REST API documentation, the key "method" is conventionally used to specify the HTTP method.
Step 2: Evaluate the options
"method": "POST" uses "method" with a valid HTTP method "POST". Other options use incorrect keys like "httpMethod", "action", or "type" which are not standard.
Final Answer:
"method": "POST" -> Option D
Quick Check:
Standard key is "method" [OK]
Quick Trick:Use "method" key to specify HTTP method [OK]
Common Mistakes:
MISTAKES
Using non-standard keys like "httpMethod" or "action"
Confusing HTTP method with request body content
Omitting the method key entirely
Master "API Documentation" in Rest API
9 interactive learning modes - each teaches the same concept differently