receive post using a DefaultHttpServerConnection object

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

receive post using a DefaultHttpServerConnection object

Postby Vermouth » Tue Aug 18, 2009 5:00 pm

Hello !

I would like to receive the body (all of his entity) of a http post.

I use this:
Code: Select all
DefaultHttpServerConnection serv_con = new DefaultHttpServerConnection
();
serv_con.bind(client_socket, new BasicHttpParams());
HttpRequest header = serv_con.receiveRequestHeader();
BasicHttpEntityEnclosingRequest http_enclo = new
BasicHttpEntityEnclosingRequest(header.getRequestLine());
serv_con.receiveRequestEntity(http_enclo);
HttpEntity ent = http_enclo.getEntity();


And this simple form (get it first with a GET request):
Code: Select all
<html>
<body>
<form  enctype="multipart/form-data" method="post" action="">
<input type="text" value="abcdefghijk" name="text"/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>


But the stream ent.getContent() not contain any data :/ !

I think i don't understand ^^ !

How i can receive one or more entity of a post request ?

Thank in advance :) !
/!\ Bad English Speaker /!\
Tell me if a sentence is not corect :P
Vermouth
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Apr 15, 2009 2:01 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 2 guests