Page 1 of 1
submission with POST
Posted: Sun Jun 24, 2007 6:54 am
by adum
the puzzles will now accept HTTP POST requests for automated problem submissions. use the same vars as for the GETs. (this first cropped up with Mortal Coil, level 437 -- nasty one.)
adum
Re: submission with POST
Posted: Fri Jan 22, 2010 6:54 pm
by hackerssmart
ken.1608, hello
Posted: Sun Dec 12, 2010 12:39 pm
by JanB
The POST-Sbmission seems to be broken. All the Data I submit is ignored. I test it with a test script on my own Server and it received my data, so my program seems to be ok.
Posted: Wed Jun 29, 2011 12:29 pm
by Tenebrar
How would you do a POST request in java? I'm at level 92 of crossflip, and my code no longer seems to work:
URL u;
u = new URL("
http://www.hacker.org/cross/index.php?name=" + $name + "&password=" + $password + "&sol=" + sol);
InputStream is = u.openStream();
BufferedReader in = new BufferedReader(new InputStreamReader(is));
String line;
while ((line = in.readLine()) != null)
{
System.out.println(line);
}
is.close();
Posted: Wed Jun 29, 2011 6:01 pm
by bodjo
after many trys i got post method working
Posted: Sun Aug 14, 2011 2:12 am
by compudemon
this is the solution posting section of the solver code in Java. it should be easy to adapt this to any game here, just change the url address and the writer.write line with '&' separated key/value pairs like a get line would have. i tried other examples but seems the page here was ignoring me till i added the content-type.
Code: Select all
public boolean solve() throws Exception {
URL u;
String path = findSolutionPath();
System.out.println("solved at (" + startX + ", " + startY
+ ") : " + path);
String enc="UTF-8";
u = new URL("http://www.hacker.org:80/coil/index.php");
URLConnection conn=u.openConnection();
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
OutputStreamWriter writer=new
OutputStreamWriter(conn.getOutputStream());
writer.write("name=" + URLEncoder.encode(name, enc) +
"&password=" + URLEncoder.encode(pw, enc) +
"&path=" + path + "&x=" + startX + "&y=" + startY);
writer.flush();
BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
rd.readLine();
writer.close();
rd.close();
return false;
}