Új hozzászólás Aktív témák
-
pawee
tag
na eddig eljutottam nagyjábó megyeget a dolog, már scak annyit szertnék kérni segítségül hogy a HTTP kódokat hogytom kierőszakolni, és a fájlokat lementeni a szerverről?
public class ddd {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
String hostname = "startlap.hu";
int port = 80;
InetAddress addr = InetAddress.getByName(hostname);
Socket socket = new Socket(addr, port);
String path = "/";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF8"));
wr.write("POST "+path+" HTTP/1.0\r\n");
wr.write("Content-Length: "+data.length()+"\r\n");
wr.write("Content-Type: application/x-www-form-urlencoded\r\n");
wr.write("\r\n");
wr.write(data);
wr.flush();
// System.out.println(socket.toString());
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
/**String line;
while ((line = rd.readLine()) != null) {
}**/
wr.close();
rd.close();
} catch (Exception e) {
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Apple iPhone 17 Pro 256GB Deep Blue- ÚJ, BONTATLAN, független, 1év garancia
- Asus GL553VD FY010T - Intel i7-7700, 16GB RAM, GTX1050 4GB, Samsung 970 NVME 250GB
- Logitech G SAITEK Farm Sim Controller
- Eladó Google Pixel 7pro 8/128. OLVASS
- Dell Precision 3591 FHD Touch / Ultra 7 155H 16C / 16-32G / 512G G4 / RTX Ada / AI IR FPR
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest

