i trying send data java code php code use of post request. reason on php side nothing @ all, code "works" (no exception occurs). can problem? in advance! data looks this:
"data=" + sb.tostring() and code can found here below:
public static void sendrequest(string encryptedstring) { httpurlconnection connection = null; bufferedreader br = null; dataoutputstream dos = null; try { connection = (httpurlconnection) new url("http://localhost/something/function").openconnection(); connection.setdooutput(true); connection.setrequestmethod("post"); connection.setrequestproperty("content-type", "application/x-www-form-urlencoded"); connection.setfixedlengthstreamingmode(encryptedstring.length()); dos = new dataoutputstream(connection.getoutputstream()); dos.writebytes(encryptedstring); dos.flush(); br = new bufferedreader(new inputstreamreader(connection.getinputstream())); string line; while((line = br.readline()) != null) { system.out.println(line); } } catch (ioexception e) { system.out.println("can't create connection..."); e.printstacktrace(); } { try { if(dos != null) dos.close(); if(connection != null) connection.disconnect(); if(br != null) br.close(); } catch (ioexception e) { e.printstacktrace(); } } } ps: picture: 
the problem encrypted whole data=randomnumber thing sha-1. data= part should not encrypted , needs added later.
Comments
Post a Comment