Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What are the commands to convert a JSON to an Object and vice versa (an Object to a JSON)? O JSON.parse() + JSON.stringify() O JSON.open()

 What are the commands to convert a JSON to an Object and vice versa (an Object to a JSON)? O JSON.parse() + JSON.stringify() O JSON.open() + JSON.create() O JSON.object() + JSON.json() O JSON.read() + JSON.write() ?


QUESTION 2 In a fetch response, the "ok" property (i.e. response ok) represents what status code? O 300 O 200 O 400 O 500 ?


QUESTION 3 When a user logs in, the server checks whether the credentials in the database match (i.e. correct username and This is an example of O Authentication O Association O Authorization O Automation?


QUESTION 4 Given this cookie, app use(clientSessions({ cookieName: "session" secret: "test5_web322_secret". duration: 2 * 60 * 1000, activeDuration: 1000 * 60 })); How do we access the session information from a request (reg) object? O req session O req.users O req.user O req.test5_web322_secret?


Ques5 What is the following code an example of? app.get("/api/users". (req, res) => { res.json(message: "fetch all users"}); }); app.post("/api/users". (req, res) => { res.json({message: "add a user"}); app get("/api/users/ userld", (req, res) => { res.json({message: "get user with ld." + req params userId}); app put("/api/users/userld" (req, res) => { res json({message: "update User with ld" + red params.userId}); app delete("/api/users/userld", (req, res) => { res.json({message "delete User with ld." + reg params userId}); O SOAP API O GraphQLAPI O REST API O Not an API?


QUESTION 6 What is the max size of a web cookie? O 4 KB O 1 GB O 1 SCOOP O Unlimited size?


QUESTION 7 AJAX can handle all of these data types but what does AJAX stand for? O Asynchronous Javascript and JSON O Asynchronous Javascript and Text O Asynchronous Javascript and HTML O Asynchronous Javascript and XML?


Ques 8 If the page "https://web322.ca/test/answers" exists but the current user doesn't have access to it - what status code? 0 401 O 200 0 404 O 403?


Ques9

 

Make a fetch request (POST) to 'https://web322.ca/api/tests/ with the body of the request including "week": "9" and "topic":"AJAX". Make sure to use JSON and console.log the resulting JSON from the promise using then()?

Step by Step Solution

3.25 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

Solution QUESTION 1 The correct commands to convert a JSON to an Object and vice versa an Object to a JSON are JSONparse and JSONstringify JSONparse takes a JSON string as an argument and returns a Ja... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Microeconomics

Authors: Hal R. Varian

9th edition

978-0393123975, 393123979, 393123960, 978-0393919677, 393919676, 978-0393123968

More Books

Students also viewed these Programming questions