Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a GET request?
A GET request asks a server to send data to you. It is like asking for information without changing anything on the server.
Click to reveal answer
beginner
What is a POST request?
A POST request sends data to a server to create or update something. It is like submitting a form or sending information to be saved.
Click to reveal answer
beginner
When should you use a GET request instead of POST?
Use GET when you want to get or read data without changing anything. For example, loading a webpage or searching for information.
Click to reveal answer
intermediate
Why should sensitive data not be sent with GET requests?
GET requests show data in the URL, which can be seen by others or saved in history. Sensitive data should be sent with POST to keep it hidden.
Click to reveal answer
intermediate
How do GET and POST requests differ in how they send data?
GET sends data in the URL as parameters, while POST sends data inside the request body, which is not visible in the URL.
Click to reveal answer
Which HTTP method is used to retrieve data without changing it?
APUT
BPOST
CDELETE
DGET
✗ Incorrect
GET requests are used to get or read data without making changes.
Which request method sends data inside the request body?
APOST
BGET
CHEAD
DOPTIONS
✗ Incorrect
POST requests send data inside the request body, keeping it hidden from the URL.
Why is it not safe to send passwords using GET requests?
ABecause GET requests are slower
BBecause GET requests delete data
CBecause GET requests show data in the URL
DBecause GET requests do not work on mobile
✗ Incorrect
GET requests include data in the URL, which can be seen or saved, risking exposure of sensitive information.
Which method would you use to submit a form with user information?
AGET
BPOST
CTRACE
DCONNECT
✗ Incorrect
POST is used to send data to the server, such as form submissions.
What happens when you use a GET request in a web browser?
AIt requests data from the server to display
BIt sends data to update the server
CIt deletes data on the server
DIt encrypts the data automatically
✗ Incorrect
GET requests ask the server to send data, like loading a webpage.
Explain the difference between GET and POST requests in simple terms.
Think about when you want to just look at information versus when you want to send information.
You got /4 concepts.
Describe a real-life example where you would use a POST request instead of GET.
Think about when you fill out a form online and press submit.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of a GET request in web communication?
easy
A. To ask for data without changing anything on the server
B. To send data to create or update information on the server
C. To delete data from the server
D. To authenticate a user
Solution
Step 1: Understand the role of GET requests
GET requests are used to retrieve or ask for data from a server without making any changes.
Step 2: Compare with other request types
POST requests send data to the server to create or update information, unlike GET which only reads data.
Final Answer:
To ask for data without changing anything on the server -> Option A
Quick Check:
GET = Read data [OK]
Hint: GET requests only fetch data, no changes made [OK]
Common Mistakes:
Confusing GET with POST as both send data
Thinking GET changes server data
Assuming GET deletes data
2. Which of the following is the correct way to send data using a POST request in a typical web form?
easy
A. Using URL parameters like ?name=John&age=30
B. Sending data as a cookie only
C. Appending data to the URL path directly
D. Including data in the request body, not visible in the URL
Solution
Step 1: Identify how POST sends data
POST requests send data inside the request body, which is not shown in the URL.
Step 2: Differentiate from GET request data sending
GET requests send data via URL parameters, visible after a question mark, unlike POST.
Final Answer:
Including data in the request body, not visible in the URL -> Option D
Quick Check:
POST = Data in body [OK]
Hint: POST data goes in body, not URL [OK]
Common Mistakes:
Using URL parameters for POST data
Confusing GET and POST data locations
Thinking POST data is visible in URL
3. Consider a web page that uses a GET request to fetch user details and a POST request to update user details. What will happen if you try to update user details using a GET request instead?
medium
A. The server will ignore the update and only send data
B. The server will return an error because GET cannot update data
C. The user details will be updated successfully
D. The server will delete the user details
Solution
Step 1: Understand GET request behavior
GET requests are designed to retrieve data and should not change server data.
Step 2: Predict server response to update attempt via GET
Most servers ignore any update attempts sent via GET and just return the requested data.
Final Answer:
The server will ignore the update and only send data -> Option A
Quick Check:
GET = Read only, no update [OK]
Hint: GET never updates, server ignores update attempts [OK]
Common Mistakes:
Assuming GET can update data
Expecting an error always on wrong method
Confusing GET with POST behavior
4. A developer wrote this code to send data to a server:
C. GET requests should not have a body; data won't be sent
D. JSON.stringify cannot be used in fetch
Solution
Step 1: Check HTTP method and body usage
GET requests do not support sending a body; any body is ignored by browsers and servers.
Step 2: Identify correct method for sending data
To send data in the body, the method should be POST or PUT, not GET.
Final Answer:
GET requests should not have a body; data won't be sent -> Option C
Quick Check:
GET = No body allowed [OK]
Hint: GET requests never send body data [OK]
Common Mistakes:
Adding body to GET requests
Using wrong HTTP method case
Thinking JSON.stringify is invalid in fetch
5. You want to build a form that submits user feedback without changing the page URL or showing data in the URL bar. Which request method should you use and why?
hard
A. GET, because it is faster and shows data in URL
B. POST, because it sends data in the request body and keeps URL clean
C. GET, because it can send large amounts of data securely
D. POST, because it appends data to the URL for easy sharing
Solution
Step 1: Identify the requirement to keep URL clean
Showing data in the URL bar means using GET, which appends data as URL parameters.
Step 2: Choose method that sends data in body and keeps URL unchanged
POST sends data in the request body, so the URL stays clean and data is not visible.
Final Answer:
POST, because it sends data in the request body and keeps URL clean -> Option B