200-901 · Question #118
FILL BLANK Fill in the blanks to complete the cURL command that invokes a RESTful API to retrieve a resource in JSON format using OAuth. curl -X ____________ -H " __________: application/json" \ -H…
The correct answer is A. GET B. Accept C. Authorization. Retrieving a JSON resource via cURL with OAuth requires the GET method, the Accept header to specify the response format, and the Authorization header to carry the Bearer token.
Question
Options
- AGET
- BAccept
- CAuthorization
How the community answered
(35 responses)- A100% (35)
Why each option
Retrieving a JSON resource via cURL with OAuth requires the GET method, the Accept header to specify the response format, and the Authorization header to carry the Bearer token.
GET is the correct HTTP method for retrieving a resource from a RESTful API without modifying server state.
The Accept header informs the server which media type the client expects in the response - 'application/json' requests a JSON-formatted reply.
The Authorization header carries the OAuth Bearer token, which authenticates the API request to the protected endpoint.
Concept tested: RESTful API cURL syntax with OAuth Bearer token
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization
Topics
Community Discussion
No community discussion yet for this question.