Actually, the Content-Type should be "application/octet-stream". I want to
send binary data from the client. I can't seem to figure out how to get this
stream from Wicket.
-----Original Message-----
From: Brad Grier
Sent: Thursday, November 18, 2010 10:41 AM
To: [email protected]
Subject: Getting Post Data
I need to write a url-based api into our webapp. Is there a way to mount a
shared resource that allows access to the data in a post request? The client
side might look something like:
URL url = new URL("http://localhost:8084/wicketapp/test?id=1");
URLConnection con = url.openConnection();
con.setDoInput (true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
DataOutputStream out = new DataOutputStream(con.getOutputStream());
// byte array here for example...how can wicket read in this data?
out.writeBytes(data);
out.flush();
out.close();
// process response
BufferedReader reader = new BufferedReader(new
InputStreamReader(con.getInputStream()));
I understand how to get the “id” parameter in the url but in this example is
there a way to get the byte array?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]