ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
345
345
EMPFEHLEN
-
Hallo alle zusammen!
Ich möchte einen gepackten Request an einen Server schicken.
Geht das überhaupt? Wenn ja wie?
Ich habe versucht einfach den DeflaterInputStream in ein InputStreamEntity zu packen, was anscheinend nicht funktioniert.
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
String testString = "Das ist ein Teststring, der am Ende wieder so sein sollte wie er jetzt ist."; System.out.println(testString); ByteArrayInputStream bain = new ByteArrayInputStream(testString.getBytes("UTF-8")); DeflaterInputStream din = new DeflaterInputStream(bain); HttpClient client = new ContentEncodingHttpClient(); HttpPost post = new HttpPost("http://localhost/test.php"); post.setEntity(new InputStreamEntity(din, din.available())); HttpResponse response = client.execute(post); System.out.println("Response: " + response.getStatusLine() + "\n" +convertStreamToString(response.getEntity().getContent()));
Der PHP Code dazu:
Ausgegeben wird folgendes:PHP-Code:<?php
$content = file_get_contents('php://input');
echo gzinflate($content);
?>
Code :1 2
Das ist ein Teststring, der am Ende wieder so sein sollte wie er jetzt ist. Response: HTTP/1.1 200 OK
Es kommt zu keiner Exception o.ä.
Was mach ich falsch?
Wenn ich den ByteArrayInputStream statt dem DeflaterInputStream in das Entity stecke und den inflater im php ausschalte, funktioniert es wie gewünscht nur halt ohne compressionGeändert von Unicate (14.12.11 um 10:54 Uhr)
/* no comment */
-
Hab immer noch keine Lösung gefunden.
/* no comment */
Ähnliche Themen
-
Suche Addon zur Anzeige von HTTP Requests?
Von Extremefall im Forum Internet, DSL & FlatrateAntworten: 3Letzter Beitrag: 13.05.11, 17:15 -
HTTP-Requests und Serverlast
Von FrankWST im Forum Javascript & AjaxAntworten: 12Letzter Beitrag: 08.01.10, 18:31 -
Caching von HTTP-Requests
Von pschilling im Forum Flash PlattformAntworten: 2Letzter Beitrag: 12.11.08, 11:03 -
Max. requests per second Apache/IIS
Von matdacat im Forum NetzwerkeAntworten: 0Letzter Beitrag: 24.11.05, 10:02





Zitieren
Login





