Thread Mit JS HTTP Request und Response handeln (44 answers)
Opened by esskar at 2005-03-14 01:48

pKai
 2005-04-22 17:07
#24400 #24400
User since
2005-02-18
357 Artikel
BenutzerIn
[default_avatar]
Ich habe mal auf Basis der js-datei aus esskars letztem Post, einen Post-request abgesetzt, worauf folgende Kommunikation zu Stande kommt:
[quote=Live Http headers,Mozilla 1.7.3]https://server/Scripts/munged.pl?*MODE=RCA

POST /Scripts/munged.pl?*MODE=RCA HTTP/1.1
Host: myhost.invalid
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: de-de,en;q=0.7,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: close
Content-Type: application/x-www-form-urlencoded
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 411 Length Required
Content-Type: text/html
Date: Fri, 22 Apr 2005 12:44:39 GMT
Connection: close
Content-Length: 24[/quote]
Das ist ein IIS6 und er besteht offenbar auf seine content-length.

Meine JS-function beginnt folgendermaßen:
Code: (dl )
1
2
3
4
5
function Request (url) {
var http = new Http();

if(http.Post(url, BuildEncodedDataFromForm(document.forms[0])) == HTTPERROR_SUCCESS) {
var res = http.Response();
und wurde mit dem url-String, der oben genannte wurde aufgerufen.
Wie komme ich jetzt an die Requestlänge, so dass ich sie im Header mitschicken kann?
Ist das in diesem Fall einfach die Länge des Postdata?\n\n

<!--EDIT|pKai|1114203983-->
I sense a soul in search of answers.

View full thread Mit JS HTTP Request und Response handeln