ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 210 - MCD - Level 1 discussion

Report
Export

A shopping API contains a method to look up store details by department.

To get the information for a particular store, web clients will submit requests with a query parameter named department and uri parameter named storeId

What is valid RAML snippet that supports requests from a web client to get a data for a specific storeId and department name?

A.
1. /department: 2. get: 3. uriParameter: 4. storeId:
Answers
A.
1. /department: 2. get: 3. uriParameter: 4. storeId:
B.
1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department:
Answers
B.
1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department:
C.
1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}:
Answers
C.
1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}:
D.
1. /{storeId}: 2. get: 3. queryParameter: 4. department:
Answers
D.
1. /{storeId}: 2. get: 3. queryParameter: 4. department:
Suggested answer: D

Explanation:

Lets revise few concepts RAML which can help us to find the answer of this question.

URI Parameters

Lets have a look at below example.

/foos:

/{id}:

/name/{name}:

Here, the braces { } around property names define URI parameters. They represent placeholders in each URI and do not reference root-level RAML file properties as we saw above in thebaseUrideclaration. The added lines represent the resources/foos/{id}and/foos/name/{name}.

Query Parameters

Now we'll define a way to query thefooscollection using query parameters. Note that query parameters are defined using the same syntax that we used above for data types:

/foos:

get:

description: List all Foos matching query criteria, if provided;

otherwise list all Foos

queryParameters:

name?: string

ownerName?: string

Based on the above information , below is the only option which definesstoreidas uri parameter anddepartmentas query parameter.

/{storeId}:

get:

queryParameter:

department:

asked 18/09/2024
Dave Breath
49 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first