Ho scelto di inviare qui questo post perché non trovavo sezioni adatte, e visto che qui si parla anche di web server...
Dunque, io vorrei inviare una semplice richiesta POST ad un web server tramite una normale connessione TCP sulla porta 80.
Come prova ho creato su un mio spazio una pagina PHP che legge 3 variabili POST e le scrive semplicemente nell'HTML.
Questa è la richiesta che invio al server:
codice:
POST /post.php HTTP/1.1
Host: joeseggiola.areafilm.net
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 5.1)[...]
Referer: http://www.[...]
Content-Type: application/x-www-form-urlencoded
Content-Length: 35
var1=varibile&var2=due&var3=var3tre
Il server mi risponde sempre con:
codice:
HTTP/1.1 200 OK
Date: Sun, 20 Nov 2005 11:01:31 GMT
Server: Apache/1.3.33 (Unix) [...] OpenSSL/0.9.7a PHP-CGI/0.1b
X-Powered-By: PHP/4.3.11
Transfer-Encoding: chunked
Content-Type: text/html
ma poi segue l'HTML che è a volte è corretto, mentre altre volte (arbitrariamente! io eseguo sempre la stessa identica richiesta!) le variabili post stampate sono precedute e seguite da dei numeri/lettere e a capi...
Ad esempio:
codice:
<html>
<head><title>POST Test</title></head>
<body>
<div>POST Test</div>
<div>
var1 =
8
varibile
1b
var2 =
3
due
1b
var3 =
7
var3tre
21
</div>
</body></html>
Non so, magari è normale, io non me ne intendo...
Che mi dite?
Grazie.