Vai al contenuto

Web Science/Part1: Foundations of the web/Dynamic Web Content/Forms and HTTP post request

Da Wikiversità, l'apprendimento libero.

Forms and HTTP post request

Obiettivi di apprendimento

  1. understand the basics of HTTP POST requests
  2. become aware of security issues while transfering data to a web server
  3. be able to create a simple web form in HTML

Video

Trascrizione

<html>
<head><title>Registration Form</title></head>
<body>
<h1>Registration Form for the Web Science MOOC</h1>
<form action="servlet" method="POST">
<label for="userinput">Enter User:</label>
<input name="username" id="userinput" type ="text" onchange="validator()"/><span id="warning" style="color:red"></span>
<br>
<label for="emailinput">Enter email</label>
<input name="email" id="emailinput" type ="text" />
<br>
<input name="submit" id="submitbutton" type="submit" value="register"/>
</form>
</body>
</html>

Quiz

1 How can a client transfer any arbitrary (especially binary) data to a web server?

Placing the data in the HTTP Header
Use the form tag in HTML with method POST.
Making a GET request and appending data to the query string
In the header of a POST request
In the body of a POST request
In the body of a multipart/form-data POST request

2 What do we have to keep in mind when submitting a web form?

Only submit data and personal information if you trust the recipient web site and the transmission of the data is encrypted.
If HTTP is used all routers on your route to the server can access your data
If HTTPS is used all routers on your route to the server can access your data
The GET request for transfering form data to a server was first introduced in HTTP/1.1

Ulteriori letture

nessuna ulteriore lettura
Tu puoi definire un'ulteriore lettura qui.
In generale puoi usare il bottone di modifica nell'angolo alto in a destra di una sezione per modificarne il contenuto.

Discussioni