Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > de.comp.lang.javascript > #5070

Re: HTTP POST?

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups de.comp.lang.javascript
Subject Re: HTTP POST?
Date 2019-06-03 00:47 +0200
Message-ID <glj202Fh0k7U1@mid.individual.net> (permalink)
References (1 earlier) <POST-20190601193901@ram.dialup.fu-berlin.de> <qd09a7$8ii$1@news2.informatik.uni-stuttgart.de> <qd105o.15o.1@stefan.msgid.phost.de> <qd1dhs$hgf$1@news2.informatik.uni-stuttgart.de> <glivjhFghduU1@mid.individual.net>

Show all headers | View raw


Arno Welzel:

> Ulli Horlacher:
> 
> [...]
>> Ich hab vor im Bereich 1-10 GB Daten zu verschicken.
>> Das kann ich aber schlecht in einer Datenstruktur im RAM aufbauen, das
>> muss in 64 kB Bloecken verschickt werden.
>>
>> Mein Perl-Client macht das so. Das will ich nun in Javascript haben, weil
>> viele Leute mit Perl Code nichts anfangen koennen.
>>
>> In Javascript hab ich bisher nur rudimentaer was programmiert.
>> Deshalb frag ich ja hier.
> 
> 
> Das Problem ist, dass XMLHttpRequest.send() nicht mehrmals
> hintereinander aufgerufen werden kann, sondern nur einmal pro Anfrage.
> 
> Als Beispiel wie bei
> <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send#Example_POST>
> gezeigt:
> 
> // Neue XHR-Anfrage fuer ein HTTP POST erzeugen
> var xhr = new XMLHttpRequest();
> xhr.open("POST", "/server", true);
> xhr.setRequestHeader("Content-Type",
>   "application/x-www-form-urlencoded");
> 
> // Handler fuer Statusmeldung nach Absenden der Anfrage
> xhr.onreadystatechange = function()
> {
>     if (this.readyState === XMLHttpRequest.DONE && this.status === 200)
>     {
>         // Anfrage wurde erfolgreich beendet
>         // hier entsprechende Behandlung ergaenzen
>     }
> }
> 
> // Anfrage mit Inhalt abschicken - das geht nur einmal nach open()!
> xhr.send("foo=bar&lorem=ipsum");
> 
> // Alternativen:
> //
> // xhr.send(new Int8Array());
> // xhr.send(document);
> 
> Wenn Du kontinuierlich einen größeren Datenstrom senden willst, wirst Du
> um Websockets und eine entsprechende Serverseite dazu nicht herumkommen.

Ergänzung:

<https://www.speedtest.net> benutzt wohl eine Kombination mit Websockets
für den Download und nacheinander ausgeführten HTTP POST-Requests für
den Test der Uploads.

Das ist auch schön zu sehen, wenn man z.B. Firefox benutzt und sich in
der Entwicklerkonsole im "Network"-Tab ansieht, was da während eines
Tests passiert.


-- 
Arno Welzel
https://arnowelzel.de

Back to de.comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-05-31 18:04 +0000
  Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-05-31 21:03 +0200
    Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 13:18 +0200
      Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-01 14:15 +0200
        Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 14:34 +0200
          Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 14:37 +0200
          Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-01 15:11 +0200
            Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 15:44 +0200
            Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-01 16:07 +0200
              Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 20:17 +0200
          Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-01 18:43 +0200
            Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 20:19 +0200
              Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-01 22:45 +0200
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-02 05:02 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-02 18:05 +0200
                Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-02 09:37 +0200
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-02 13:39 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-02 18:12 +0200
              Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-02 04:06 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-02 18:22 +0200
      Re: HTTP POST? Jan Novak <repcom@gmail.com> - 2019-06-03 14:54 +0200
  Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-02 10:44 +0000
    Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-02 14:00 +0200
    Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-02 17:14 +0200
      Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-02 21:02 +0000
        Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-03 00:06 +0200
          Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-03 00:47 +0200
            Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-03 06:06 +0000
              Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-03 18:43 +0200
        Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-03 12:38 +0200
          Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-03 15:51 +0200
            Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-03 20:26 +0000
              Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-04 19:31 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-05 06:09 +0000
            Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-04 21:48 +0200
              Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-05 06:14 +0000
        Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-03 18:34 +0200
          Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-03 20:31 +0000
            Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-04 18:09 +0200
              Re: HTTP POST? Manfred Haertel <Manfred.Haertel@rz-online.de> - 2019-06-05 05:50 +0200
              Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-05 06:30 +0000
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-05 15:07 +0200
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-05 18:09 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-05 20:25 +0000
                Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-06 09:49 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-06 08:47 +0000
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-08 14:53 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-08 19:31 +0000
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-08 14:50 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-08 19:34 +0000
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-09 00:45 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-10 17:29 +0200
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-09 11:10 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-09 12:06 +0000
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-10 11:16 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-10 09:47 +0000
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-10 20:35 +0200
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-11 17:50 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-11 20:02 +0000
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-12 07:45 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-12 06:08 +0000
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-12 10:16 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-12 09:05 +0000
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-12 10:37 +0200
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-12 18:14 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-12 21:28 +0000
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-12 23:55 +0200
                Re: HTTP POST? Manfred Haertel <Manfred.Haertel@rz-online.de> - 2019-06-13 05:35 +0200
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-13 07:40 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-15 18:33 +0200
                Re: HTTP POST? Stefan Reuther <stefan.news@arcor.de> - 2019-06-14 18:08 +0200
                Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-10 17:37 +0200
                Re: HTTP POST? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2019-06-10 16:31 +0000
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-10 21:45 +0200
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-10 22:04 +0200
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-11 00:23 +0200
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-11 00:33 +0200
                Re: HTTP POST? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-11 01:01 +0200
                Re: HTTP POST? Ralph Aichinger <ra@pi.h5.or.at> - 2019-06-10 20:24 +0200
                Re: HTTP POST? Arno Welzel <usenet@arnowelzel.de> - 2019-06-11 10:48 +0200
                Re: HTTP POST? Claus Reibenstein <4spamersonly@kabelmail.de> - 2019-06-11 11:57 +0200

csiph-web