Bird
Raised Fist0

A developer wrote this code snippet to fetch a webpage securely:

medium📝 Analysis Q14 of Q15
Intro to Computing - How the Internet Works
A developer wrote this code snippet to fetch a webpage securely:
fetch('http://secure-site.com/data')

What is the main problem here?
AThe URL is missing a domain extension
BThe fetch function is misspelled
CThe URL uses HTTP instead of HTTPS
DThe code is missing a semicolon
Step-by-Step Solution
Solution:
  1. Step 1: Check URL protocol

    The URL uses http:// which is not secure for sensitive data.
  2. Step 2: Identify correct secure protocol

    To fetch data securely, the URL should start with https://.
  3. Final Answer:

    The URL uses HTTP instead of HTTPS -> Option C
  4. Quick Check:

    Secure fetch needs HTTPS URL [OK]
Quick Trick: Secure fetch requires HTTPS URL [OK]
Common Mistakes:
MISTAKES
  • Ignoring the protocol difference
  • Thinking semicolon is mandatory in JavaScript fetch
  • Assuming fetch is misspelled

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Intro to Computing Quizzes