0% found this document useful (0 votes)
16 views16 pages

RestfulQB Mphasis

The document contains a series of questions and answers related to RESTful web services, covering topics such as HTTP methods, caching best practices, JAX RS API annotations, and Spring application integration. It includes multiple-choice questions with correct answers indicated for each. The content serves as a study guide or quiz format for understanding RESTful web services and their implementation.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views16 pages

RestfulQB Mphasis

The document contains a series of questions and answers related to RESTful web services, covering topics such as HTTP methods, caching best practices, JAX RS API annotations, and Spring application integration. It includes multiple-choice questions with correct answers indicated for each. The content serves as a study guide or quiz format for understanding RESTful web services and their implementation.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
You are on page 1/ 16

SNO QFLAG QTEXT

Which of the following is correct about addressing in RESTful web


services?

2 Which of the following HTTP method should be used to create resource using

3 Which of the following is a best practice for caching in RESTful web service?
Which of the following component of HTTP request contains message
4 content or Resource representation?

5 Name the protocol which is used by RESTful web services

6 REST proposed by whom?

7 How to set default text/html format for restful web services?

8 What is WADL?

9 What kind of security used for SOAP?

10 Which protocol will use to process the request in SOAP?

11 Define One-to-one Mapping Between Http Methods And Crud?

12 Name The Most Commonly Http Methods Used In Designing Restful Services?
13 Which of the following HTTP Status code means OK REQUEST, states that valid

14 What is the main principle of client-server architecture?

15 Which of the following annotation of JAX RS API is used to annotate a method

16 Which of the following annotation of JAX RS API is used to get status of method

17 Which of the following directive of Cache Control Header of HTTP response indicates that resource is ca

18 Which of the following HTTP method should be idempotent in nature?

19 Where caching improves performance?

20 Name the various communication channels in RESTful web service?

21 What is the alternate solution to Response Caching?

22 What are the request/response type in REST web services?

23 What are the request/response type in SOAP web services?

24 Which is more secure REST or SOAP?

25 What are the core components of HTTP request?

26 What are the core components of HTTP response?


27 Where can create a REST api using visual studio?

28 Where the http based services can lie?

29 What are the different hosting REST api supports ?


30 How to define default route in config file?

31 What is W3C?

32 What is OWIN?
33 What are the different approach to create entity?

34 Which namespace will use to set http route?


35 What are HTTP Status Codes?
36 What are main return types supported in Web API?
37 Which .NET framework supports Web API?
38 By default, Web API sends HTTP response with which of the following status c
39 What is the biggest disadvantage of “Other Return Types” in Web API?
40 How can we make sure that Web API returns JSON data only?

41 How to call rest api using ajax?

42 What is difference between put and post method in rest api?


43 When to use PUT and When PATCH?
44 Which method can apply routing?

What is the output for this code ? Request:


GET https://api.everlive.com/v1/your-app-id/Books
Headers:
Authorization Bearer your-access-token
X-Everlive-Sort { "Author" : 1 }
45

What is the output for this code ? Request:


GET https://api.everlive.com/v1/your-app-id/Books
Headers:
Authorization Bearer your-access-token
46 X-Everlive-Sort { "Author" : -1 }
47 What are the operations support by Paging?

48 Which is the json format?


49 where to define the multiple routes in web api?
50 Which is default format of rest api request?
51 What is use of status code 400?
52 What is the status code 200?
53 What is yhe status code 404?
54 What are the client error codes?
55 What are the server error codes?
56 What are the success error code?
57 What is URI?
58 What are Naming Guidelines used for REST Resource ?
59 What are the methods used in SOAP?
60 Which are the Restful APIs?
a b c d e f ANSWER

Addressing
refers to
locating a
resource or It is analogous to
multiple locate a postal
resources lying address of a
on the server. person. representationa
A and B l service token c

GET DELETE OUT OPTIONS c

Request Body URI Request Header HTTP Version a

JSON HTTP TCP/IP FTP b

WWW WWC WC WWWC a

SupportedMedi
SupportedMedi SupportedMedia aTypes.Add(ne
aTypes.Add(new Types.Add(new SupportedMediaType w
MediaTypeHead MediaTypeHead s.Add(new MediaTypeHea
erValue("text/te erValue("html/te MediaTypeHeaderVal derValue("html
xt")); xt")); ue("text/HTML")); /html")); c

windows
web application application webservices web api
description description application description
language language description language language a

SSL WS-Security web-security xml-security a,b

Endpoint URI Resource URI Endpoint URL Resource URL a

PUT maps to get maps to


update, GET PUT maps to Create, post
maps to Create, GET PUT maps to update, maps to
Retrieve, POST maps to Retrieve, GET maps to post Retrieve, put
maps to create, POST maps to POST maps to create maps to
DELETE maps to Update, DELETE DELETE maps to Update, DELETE
Delete. maps to Delete. Delete. maps to Delete. b

post get delete put a,b,c,d


201 200 400 401 b
seperation of seperation of seperation of
code architecture seperation of request concerns d

"@path" "@get" "@put" "@Post" d

"@delete" "@produces" "@head" "@Consumes" c


no-cache/no
private public max-age store b

delete option post head a

server side client side client-server side not improve b

HTTP/POST HTTP/GET HTTP/Delete HTTP/PUT a,b


Response memory
caching Data caching web caching caching b

Plain text JSON XML HTML a,b,c

Plain text JSON XML HTML c

REST SOAP BOTH NOT BOTH b

URI Request body Request Header request head a,b,c

status code response header response body response head a,b,c


controller event filters app.config a
entity
framework .net framework buisness layer data layer b

IIS self hosting no hosting remote hosting a,b


routeTemplate: "arouteTemplate: "a routeTemplate: "api/{c routeTemplate: "api{controller}{id}" b

World wide
World wide web World wide web World wide web windows
common consortium console console b

Open Web Open Windows Open Web Open Windows


Interface Interface Intermediate Intermediate a
database first model first code first entity first a,b,c
system.http.rou
system.web.http system.http.web system.web.route te a
200 201 305 307 a,b,d
httpResponseMe
void ssage IHttpActionResult ActionResult a,b,c
4 4.5 3 3.5 a,b
200 400 500 600 c
202 error 301 error 401 error 400 error d
Add(new MediaTyAdd(new MediaTypAdd(new MediaTypeHeaAdd(new MediaTypeHeaderValue("json/ap
b

$.ajax({ $.ajax({
type: "Put", $.ajax({ type: "GET",
dataType: type: "GET", $.ajax({ dataType:
"JSONP", dataType: type: "POST", "jsonp",
url: "jsonp", dataType: "jsonp", url:
"http://localhost url: url: "http://localhos
:8080/restws/js "http://localhost: "http://localhost:8080 t:8080/restws/j
on/product/get" 8080/restws/json /restws/json/product/ son/product/po
, /product/get", get", st", b

put method is post method is post method is not put method is


idempotent idempotent idempotent not idempotent a
When a client neeWhen they’re doing
When a client needs to When they’re doing a partial update, th a,d
action non-action action, non-action all method a

auther in assendi auther in decendi id in assending order id in decending order a

auther in assendi auther in decendi id in assending order id in decending order b


Read write Delete GET a,c

{ { {
“code”: "1234", “code”: 1234, “code”= 1234,
“message” : “message” : { “message” =
“Something bad “Something bad code: 1234, “Something bad
happened :(“, happened :(“, message : Something happened :(“,
“description” : “description” : bad happened :(, “description” =
“More details “More details description : More “More details
about the error about the error details about the error about the error
here” here” here here”
} } } } b
Above Default ro Below default rou inside route cant define multiple route a
json xml string html b
Bad Request Ok proxy error not found a
Bad Request Ok proxy error not found b
Bad Request Ok proxy error not found d
400 401 500 501 a,b
400 401 500 501 c,d
300 200 201 500 b,c
Universal ResourcUniversal ResourceUniform Resource IdentiUniform Resource Identity c
Do not use undersUse lowercase lett use file extenstions Never use CRUD function names in URIs a,b,d
get put post delete c
RAML Hypermedia RSDL Odata a,b,c,d
IMG_PAT SUB_TOPI
H LEVEL TOPIC C REMARK QUE_ID

Basic
1 Restful web services REST
Basic
1 Restful web services REST
Basic
1 Restful web services REST
Basic
2 Restful web services REST
REST
2 Restful web services Intro
REST
1 Restful web services Intro

REST
Formatter
3 Restful web services s

REST
2 Restful web services Basic
REST
3 Restful web services Basic
REST
1 Restful web services Basic

REST
2 Restful web services Basic
REST
2 Restful web services Basic
REST
1 Restful web services Basic
REST
2 Restful web services Basic
REST
2 Restful web services Basic
REST
2 Restful web services Basic
REST
1 Restful web services Basic
REST
1 Restful web services Basic
REST
1 Restful web services Basic
REST
2 Restful web services Basic
REST
2 Restful web services Basic
REST
1 Restful web services Basic
REST
1 Restful web services Basic
REST
1 Restful web services Basic
REST
2 Restful web services Basic
REST
2 Restful web services Basic
3 Restful web services REST Into

3 Restful web services REST Into

3 Restful web services REST Into


3 Restful web services REST Into

1 Restful web services REST Into

2 Restful web services REST Into


3 Restful web services REST Into

2 Restful web services REST Into


1 Restful web services REST Into
3 Restful web services REST Into
3 Restful web services REST Into
3 Restful web services REST Into
3 Restful web services REST Into
3 Restful web services REST Into

3 Restful web services REST Into

2 Restful web services REST Into


3 Restful web services REST Into
3 Restful web services REST Into

3 Restful web services REST Into

3 Restful web services REST Into


2 Restful web services REST Into

3 Restful web services REST Into


2 Restful web services REST Into
1 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
2 Restful web services REST Into
3 Restful web services REST Into
1 Restful web services REST Into
3 Restful web services REST Into
1.Which of the following is correct about addressing in RESTful web services?
A - Addressing refers to locating a resource or multiple resources lying on the server.
B - It is analogous to locate a postal address of a person.
C - Both of the above.
D - None of the above
2.Which of the following HTTP method should be used to create resource using RESTful web service?
A - GET
B - DELETE
C - PUT
D - OPTIONS

3. Which of the following is a best practice for caching in RESTful web service?

A - Always keep static contents like images, css, JavaScript cacheable, with expiration date of 2 to 3 days.

B - Never keep expiry date too high.


C - Dynamic contents should be cached for few hours only.

D - All of the above.

4. Which of the following annotation of JAX RS API binds the parameter passed to method to a HTTP header?

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

5. Accessing a third-party REST service inside a Spring application.


a) RestTemplate Class
b) ViewResolver
c) InternalViewResolver
d) View
6. RestTemplate class method which performs an HTTP HEAD operation.
a) headForHeaders(String, Object…)
b) getForObject(String, Class, Object…)
c) postForLocation(String, Object, Object…)
d) postForObject(String, Object, Class, Object…)

7. To publish a REST service with Spring.


a) publishing an application’s data as a REST service
b) accessing data from third-party REST services
c) none of the mentioned
d) all of the mentioned
8. Accessing a third-party REST service inside a Spring application.
a) RestTemplate Class
b) ViewResolver
c) InternalViewResolver
d) View

9. Accessing a third-party REST service inside a Spring application.


a) RestTemplate Class
b) ViewResolver
c) InternalViewResolver
d) View

10. REST service end point comprises an address.


a) starts with http:// and ends with ?
b) starts with http:// and ends with &
c) no certain URL is specified
d) depends upon the platform used
1. c
2. c
3. d
4. d
5. a
6. a
7. d
8. a
9. a
a

You might also like