When we use http.createServer(callback). The callback function takes in two objects, what are these?
Server and APIs

Quiz
•
Professional Development
•
Professional Development
•
Hard
Daniel Adesoji
Used 19+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
request, response
handler,response
response,handler
request,process
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
We want the content type of the response to be 'text/html'. Which of the following is the correct way to do it?
res.setHeader('content-type', 'text/html')
res.setHeader('content-type', 'application/json')
res.writeHeader('content-type', 'text/html')
res.writeHead('content-type', 'text/html')
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To set the status code of response, what would be the correct syntax?
res.writeHeader(200)
res.writeHead(200)
res.writeStatus(200)
res.writeCode(200)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When we query for data from an api, what code do we return when that data is not found
400
422
404
419
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When we build an API server, what content type do we set?
text/html
application/json
application/api
application/html
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To read the url from the request, what property of req do we use?
url
path
link
none of the options
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A request is creating a resource in your API server, the method is "req.method === ?"
PUT
PATCH
GET
POST
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
PH Pr#d#ct H#ng##t: #W#ll#t

Quiz
•
Professional Development
14 questions
HTML Basics

Quiz
•
Professional Development
10 questions
Supply Week-1_January'23

Quiz
•
Professional Development
8 questions
Aula 03 Web design

Quiz
•
Professional Development
10 questions
Information and Communication Technology

Quiz
•
Professional Development
10 questions
Panduan Penanganan Tiket Internal Process

Quiz
•
Professional Development
11 questions
Nodejs: Express

Quiz
•
Professional Development
10 questions
Nodejs: Error Handling

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade