upload_file
Form Submission Methods
<form action="/submit" method="post">
check_circle
Forms send data to server using HTTP methods
check_circle
Two primary methods: GET and POST
check_circle
Method specified in method attribute of form
check_circle
Default method is GET if not specified
compare_arrows
Key Differences
| Aspect | GET | POST |
|---|---|---|
| Data Location | URL parameters | Request body |
| Security | Less secure | More secure |
| Data Size | Limited (~2048 chars) | No limit |
| Bookmarkable | Yes | No |
| Caching | Can be cached | Not cached |
rule
When to Use Each Method
GET: Search queries, filtering, navigation
POST: Login forms, file uploads
GET: When URL should be bookmarkable
POST: Sensitive data (passwords, credit cards)