0

I'm trying to read some information from a Website (http://www.ths-pinneberg.de/vplan/index.php?klasse=Q1c). You will need a Password. I have the Password saved on my computer but my Arduino not. My question is how the HTTP request has to look like when I want to send the Password in the same request. My current request looks like this:

GET /vplan/index.php?klasse=Q1c HTTP/1.1
Host: www.ths-pinneberg.de
User-Agent: arduino-ethernet
Connection: close

And the Server answers:

HTTP/1.1 200 OK
Date: Fri, 18 Aug 2017 19:06:56 GMT
Server: Apache
X-Powered-By: PHP/5.6.30-0+deb8u1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=e8d2772544a40ce8f333befb78d6429e; path=/
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

174
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
  <title>Vertretungspl&auml;ne an der THS</title>
  <meta name="generator" content="Bluefish 2.2.9" >
  <meta http-equiv="Content-Type" content="text/html; charset=iso8859-15">
  <link rel="stylesheet" type="text/css" href="default.css">

</head>
<body>

20e
<div id='wrap'>
<div id="header">
    <!-- Grafik f&#252;r den Header-->
    <h1>Vertretungspl&auml;ne der THS Pinneberg</h1>

</div>
<p></p><div class='login'><p>Du musst das g&uuml;ltige THS-Passwort eingeben!<br>Sie m&uuml;ssen das g&uuml;ltige THS-Passwort eingeben!</p><form action='/vplan/index.php' method='POST'><p>Passwort: <input type='password' name='password'><input type='submit' name='login' value='Anmelden'></p><p>&nbsp;</p><p><input type='checkbox' name='save_password'>Dauerhaft anmelden</p></form></div>
0

The translation of the second last line is: "Du musst das gültige THS-Passwort eingeben!" to "You have to enter the correct password" "Passwort" to "password" "Anmelden" to "login" "Dauerhaft anmelden" to "remember password"

What does that request have to look like?

  • 1
    Use Wireshark or Fiddler to capture the request and look at it. Then just replay the request. – GiantTree Aug 18 '17 at 21:15
  • Send an Authorization header of type Basic with the username and password encoded in base64. See here for details. – David Schwartz Aug 19 '17 at 0:10
1

just a little update I have solved my problem (thanks to GiantTree). The solution was that I programmed the Arduino to send two HTTP request, because the basic authorization didn't worked, because its just not a basic authentication. The first request goes to the login page to show it and the second request filled in the login an proceeded to the directory I wanted to see. Hope that helps others with the same problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.