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?