0% found this document useful (0 votes)
21 views21 pages

Rest-S2 QB-1

The document contains a series of questions and answers related to RESTful web services, HTTP methods, and API development. It covers topics such as resource creation, architectural constraints, authentication, caching, and error handling. Additionally, it includes code snippets and explanations for various programming scenarios involving REST APIs.

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)
21 views21 pages

Rest-S2 QB-1

The document contains a series of questions and answers related to RESTful web services, HTTP methods, and API development. It covers topics such as resource creation, architectural constraints, authentication, caching, and error handling. Additionally, it includes code snippets and explanations for various programming scenarios involving REST APIs.

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/ 21

SNO QFLAG QTEXT a

Which of the following HTTP method should be used to create


1 resource using RESTful web service? GET

2 what are the rest architectural constraints design trade offs? response object

3 REST has been widely used, replacing Web services based SOAP,WSDL

4 Which restful method is sued create a resource on the server GET

5 Choose appropriate rest method to remove or delete a resource GET

combining User
6 how to improve the portability in REST? Interface

URI accepts only the requests with the POST method. The data •POST
attached to the request is the information of the employee to be http://localhost:8080/
7 created employee

8 what is impact client server architecture in REST ? data encapsulation

9 which http method used for request and response from server? get

10 how the response message will receive by http request? status code

11 what is REST api state choose the correct option? http state

12 how the request will be authenticated in REST? header

13 where state is managed? server side


When a client needs
to replace an existing
Resource entirely,
they can use
PUT.When they’re
doing a partial update,
they can use HTTP
PATCH.
14 When to use PUT and When PATCH?

means that the


connection between
the browser and the
server is not lost once
15 Why HTTP is stateless chhose the correct option? the transaction ends

faster access to
16 what are the advantages of caching? resourses

system.runtime.cachi
17 which is the namespace support for caching? ng

18 how the token generated while working with caching? using customer id

not to dispose
19 what is the use of Idisposable interface? method

What is Swagger?
A low-code tool
designed for REST

20

to map between
21 what is the use of mapper class chhose the correct option? entity and database

what is the output of this code?


Mapper.CreateMap<RegisterModel, tbl_Registration>(); created mapper
between
var userDto = Mapper.Map<RegisterModel, RegisterModel and
22 tbl_Registration>(reg); tbl_Registration entity
what is the output of this code? var generateCustomerTable = $
("#CustomerTable")
.dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "/api/customerSearch"
},
"columns": [
{ "data": "companyName" }, { "data": "address" }, { "data":
"postcode" }, bind the whole
{ "data": "telephone" } CustomersTable with
23 ] datatable

what is the use of this CDN? <script type="text/javascript"


src="https://cdn.datatables.net/v/dt/dt-1.10.12/datatables.min.j to include datatable
24 s"></script> reference

what is the use of this Link? <link rel="stylesheet"


type="text/css" href="https://cdn.datatables.net/v/dt/dt- to include datatable
25 1.10.12/datatables.min.css" /> reference

connection between
26 what is connector view? clients

27 which http verb used for retrieving data using dataview in rest? get

28 what is the result when cache list is null? error in data

Registry services such as managing information about service


providers, service implementations and service metadata are
29 provided by UDDI

Which of the following component of HTTP request contains Request Body


30 message content or Resource representation?

31 what services azure support for deployment? SAAS

32 which framework does microsoft azure support? only microsoft

33 Which of the following standard does Azure use ? XML


Which type of publish method can be choose to deploy database
34 to the server? web deploy

Which type of publish method can be choose to deploy web api


35 to the server? web deploy

what is the output of this code? Public


36 Ienumerable<Customer>Get(){return ctx.customers.toList()} return customer list

37 What are the kind of cloud storage public

38 What is the Windows Azure Platform? windows azure

Cross-Origin Resource
39 What is CORS? Services

what is the output of this code? public static void


Register(HttpConfiguration config)
{
config.EnableCors();
config.MapHttpAttributeRoutes();
40 } desable CORS

what is output of this code? [EnableCors(origins:


"http://localhost:59452,http://localhost:25495,http://localhost:8 Enable multiple
41 080", headers: "*", methods: "*")] localhost

what is the output of this code? [EnableCors(origins:


"http://example.com", headers: "*", methods: "*")]
public class TestController : ApiController
{
// Controller methods not shown...
42 } Enable CORS
[AllowAnonymous]
public class
AccountController :
Controller
{

public
IHttpActionResult
Get()
{
return Ok();
}
43 how to authorize the user in action? }

[AllowAnonymous]
public class
AccountController :
Controller
{

public
IHttpActionResult
Get()
{
return Ok();
}
44 how to authorize the user in controller? }

do not have
permission to post the
45 what is forbidden error in REST? request

represent Message
46 what is DelegaingHandler class in API? Handlers after routing

var tokens = request.Headers.GetValues("Authorization").FirstOr get request for


47 Default(); authorization header

requested page not


48 what is HTTP - Status Codes 401 error? found

49 what is AuthenticationHandler in Web API? return true if valid


What is the out put of this code? send HTTP GET
HttpResponseMessage response = awaitclient.GetAsync("api/De request
50 partment/1"); asynchronously

when a process
requests
51 when to call onAuthorization method? authentication

server-to-client
52 what is oauth? authentication

enables
authentication using
53 what is hostAuthenticationFilter class? bearer tokens

what is the out put of this code?


config.SuppressDefaultHostAuthentication(); enables
config.Filters.Add(new authentication using
54 HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); bearer tokens

Sent with every


55 Why token based authentication instead of cookie based? request

Below oauth 2.0


56 where the OpenID Connect layer stored? protocol

identity of the First-


57 what is OpenID Connect? User

OpenID is about
58 what is the difference between OpenID and OAuth? authentication

59 what are the parameter of OpenID connect? idp_scope

60 what is Odata? Open Data Processor

model builder that is


used to map EDM
classes to an data
61 what is oDataModelBuilder class? model

what are the OData query options that ASP.NET WebAPI


62 supports? $orderby

63 what is tracing in web api? debug the application


what is the output of this code ?
64 config.EnableSystemDiagnosticsTracing(); disable tracing

Test-First
65 which methodology used for web API unit tesing? Development

66 what is the attribute use for test method? TestMethod

import the built-


67 what is the output of this code? var http = require('http') in http module

what is the output of this code? http.createServer(function


(request, response) {

response.writeHead(200, {'Content-Type': 'text/plain'});

response.end('Hello World\n');
}).listen(8081);

68 console.log('Server running at http://127.0.0.1:8081/'); text/plain

what is the output of this code? var options = {


url: 'http://samwize.com',
method: 'POST',
headers: headers,
form: {'key1': 'xxx', 'key2': 'yyy'} request using get
69 } method

what is the output of this code? var request=require("request");


request.put('http://mysite.com/
img.png',function(error,response,body){
if(error){
console.log(error);
}else{
console.log(response);
console.log(response);
} request using get
70 }); method
IMG_PAT
b c d e f ANSWER H

DELETE PUT OPTIONS c

stateless Request object caching b,c,d

DDL DML DQL A

POST PUT DELETE b

POST PUT DELETE d

seperating User updating User deleting User


Interface Interface Interface b

•PUT •DELETE .OPTIONS


http://localhost:8080/ http://localhost:8080/ http://localhost:8080
employee employee /employee a

data abstraction scalable and reusable interface b,d

put post delete a

response head response header response body d

stateless stateful ftp state b

body Token head c

client side client server not managed b


When a client needs
When they’re doing a
to replace an existing
partial update, they Can use rest template a
Resource entirely,
can use HTTP PUT.
they can use Patch.

means that the means that the means that the


connection between connection between connection between
the browser and the the browser and the the browser and the
client is lost once the server is lost once the client is not lost once
transaction ends transaction ends the transaction ends c

provides resourses
evn origin server
saving bandwidth slow process down a,b,d

system.caching.runti
system.caching system.data.caching me a

using GUID using get method using caching data b

not to use dispose to use dispose


method method to dispose the method c

A testing tool
An alternative A tool for API design c
designed only for
protocol to REST and testing
SOAP

to map between to map between to map between


model and entity database and model method and model b

created mapper
created mapper created mapper between
between between RegisterModel
RegisterModel and RegisterModel and database and
tbl_Registration tbl_Registration tbl_Registration
model database model a
bind the searched
CustomersTable data
with datatable exception occurs code can not compile b

to include datatable add methods of add of datatable


method reference datatable plugins plugins reference c

to include datatable add methods of add of datatable


method reference datatable plugins plugins reference a

connection between connection between connection between


servers views components d

post put verb a

no data list data from server list old data c

SPARQL REST WSDL a

a
URI Request Header HTTP Version

PAAS IAAS AAAS b,c

microsoft and third only mcrosoft and no only third party


party software third party software software b

HTML REST no standards a,b,c


windows deploy web service web api a

windows deploy web service web api a

return customer code compile error no return a

private protected hybrid a,b,d

appFabric SQL Azure Web Azure a,b,c

Cross-Original Cross-Origin Resource Cross-Origin Result


Resource Sharing Sharing Sharing c

Enable CORS Remove CORS Register CORS b

Enable multiple Enable multiple


methods header Enable multiple CORS d

Enable methods Enable header Enable localhost a


[Authorize(User="Ram
")]
public class
AccountController :
Controller
{
[Authorize(User="Ram
public ")] [AllowAnonymous]
IHttpActionResult public public
Get() IHttpActionResult IHttpActionResult
{ Get() Get()
return Ok(); { {
} return Ok(); return Ok();
} } } c

[Authorize(User="Ram
")]
public class
AccountController :
Controller
{
[Authorize(User="Ram
public ")] [AllowAnonymous]
IHttpActionResult public public
Get() IHttpActionResult IHttpActionResult
{ Get() Get()
return Ok(); { {
} return Ok(); return Ok();
} } } b

do not have
do not have permission to view do not have
permission to get the the requested permission to put the
request resource request c

represent http represent Message


Handlers before represent http Handlers before
routing Handlers after routing routing d

get value for get value for get request for


authorization header authorization user authorization user b

requested page needs


requested page is not a username and a
valid. password invalid password c

throws
AuthenticationExcepti credentials to validate
on if request failed. the authorization of user a,b,c
send HTTP GET send HTTP POST send HTTP POST
response request response
asynchronously asynchronously asynchronously a

when a process when a process


response response when a process
authorization authentication requests authorization d

server-to-server client-to-server client-to-client


authentication authentication authentication b

enables enables enables


authentication using authentication using authentication using
any tokens IIS tokens OWIN tokens a

enables enables enables


authentication using authentication using authentication using
any tokens IIS tokens OWIN tokens a

Work cross domain Scalable Loosly Coupled b,c,d

Top of oauth 2.0 middle of oauth 2.0 inside of oauth 2.0


protocol protocol protocol b

identity of the End- identity of the last- identity of the outh-


User User User b

OAuth is about OAuth is about OpenID is about


authentication authorisation authorisation a,c

idp sessionToken prompt a,b,c,d

Open Data Protocol Open Data server Open Data Client b

model builder that is model builder that is model builder that is


used to map database used to map CLR used to map CLR
classes to an EDM classes to an database classes to an EDM
model model model d

$select $skip $filter a,b,c,d

shows diagnostic can not integrated


information of a single follow the path of the with system level
request execution page tracing a,b,c
Enable tracing start tracing stop tracing b

Test-driven Test- Deploy Test-End


Development Development Development a

TestClass Class Test a

import the built- import import


in https module the http module the https module a

200, {'Content-Type': Content-Type': prints at port 8081


'text/plain'} 'text/plain hello world d

request using put request using post request using delete


method method method c

request using put request using post request using delete


method method method b
COMPRE
HENSION HINT LEVEL TOPIC SUB_TOPIC REMARK QUE_ID

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
2 services REST

Restful Architectural
web constraints in
2 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
2 services REST

Restful Architectural
web constraints in
2 services REST

Restful Architectural
web constraints in
2 services REST
Restful Architectural
web constraints in
3 services REST

Restful Architectural
web constraints in
3 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
1 services REST

Restful Architectural
web constraints in
2 services REST

Restful Architectural
web constraints in
2 services REST

Restful
Webservi Microservcies
2 ces

Restful Architectural
web constraints in
3 services REST

Restful Architectural
web constraints in
3 services REST
Restful
web types of views in
3 services rest arch.

Restful
web types of views in
3 services rest arch.

Restful
web types of views in
2 services rest arch.

Restful
web types of views in
1 services rest arch.

Restful
web types of views in
1 services rest arch.

Restful
web types of views in
1 services rest arch.

Restful
Webservi
2 ces REST Webservices

Restful
Webservi
1 ces REST Webservices

Restful Deploying
web Databases and
2 services APIs

Restful Deploying
web Databases and
2 services APIs

Restful Deploying
web Databases and
2 services APIs
Restful Deploying
web Databases and
1 services APIs

Restful Deploying
web Databases and
3 services APIs

Restful Deploying
web Databases and
2 services APIs

Restful
web
3 services Microservices

Restful
web Cloud with
3 services Microservices

Restful
web
1 services Microservices

Restful
web
3 services Microservices

Restful Deploying
web Databases and
3 services APIs

Restful
web
3 services Microservices
Restful
web Security Features
3 services in REST

Restful
web Security Features
3 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
3 services in REST

Restful
web Security Features
3 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
3 services in REST
Restful
web Security Features
3 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
1 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
3 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
1 services in REST

Restful
web Security Features
3 services in REST

Restful
web Security Features
2 services in REST

Restful
web Security Features
3 services in REST

Restful
web Advance Features
1 services in REST

Restful
web Advance Features
2 services in REST

Restful
web Advance Features
1 services in REST

Restful
web Advance Features
3 services in REST
Restful
web Advance Features
3 services in REST

Restful
web Advance Features
2 services in REST

Restful
web Advance Features
3 services in REST

Restful
web Using Rest API in
3 services Node.js

Restful
web Using Rest API in
3 services Node.js

Restful
web Using Rest API in
3 services Node.js

Restful
web Using Rest API in
3 services Node.js

You might also like