nerdexam
Cisco

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.

Understanding and Using APIs

Question

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 " _______: Bearer AbCdEf123456" https://localhost/api/myresource Answer: See explanation below

Options

  • AGET
  • BAccept
  • CAuthorization

How the community answered

(35 responses)
  • A
    100% (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.

AGETCorrect

GET is the correct HTTP method for retrieving a resource from a RESTful API without modifying server state.

BAcceptCorrect

The Accept header informs the server which media type the client expects in the response - 'application/json' requests a JSON-formatted reply.

CAuthorizationCorrect

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

#cURL#REST API#HTTP Headers#OAuth

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice