Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST TOOLS

HTTP Request Methods


Share

HTTP Request Methods

The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers.

When your browser (the client) talks to a server, it sends a request. Every request has a method that tells the server what you want to do.

The most common HTTP request methods:

Method What it does
GET Read or fetch data
POST Send new data
PUT Replace existing data
PATCH Change part of existing data
DELETE Remove data

GET

GET is used to retrieve data from a server. This is the most common method.

Every time you open a web page, your browser sends a GET request.

Some notes on GET requests:

  • GET requests can be cached
  • GET requests remain in the browser history
  • GET requests can be bookmarked
  • GET requests should never be used when dealing with sensitive data
  • GET requests have length restrictions


POST

POST is used to send new data to the server, for example when you submit a form or post a comment.

The data sent to the server is stored in the request body of the HTTP request:

POST /test/demo_form.php HTTP/1.1
Host: w3schools.com

name1=value1&name2=value2

Some notes on POST requests:

  • POST requests are never cached
  • POST requests do not remain in the browser history
  • POST requests cannot be bookmarked
  • POST requests have no restrictions on data length

PUT and PATCH

Both change data that already exists:

  • PUT replaces the whole resource
  • PATCH changes only the parts you send

DELETE

DELETE deletes the specified resource from the server.


HEAD

HEAD works like GET, but returns only the headers, not the content.

A HEAD request can read the Content-Length header to check the size of the file, without actually downloading the file.


OPTIONS

OPTIONS asks the server which HTTP methods it allows.


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.