Scripting and security

Operating Systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Realizar petición HTTP mediante el método GET

Ofertas y promociones en Videojuegos

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.io.*;
import java.net.*;
 
public class PeticionGET {
public static void main(String[] args) {
try {
URL url = new URL("http://localhost:89/getypost/exampleget.php?nombre=Hello+World!&edad=23");
URLConnection conexion = url.openConnection();
// LEER DE LA URL
BufferedReader reader = new BufferedReader(new InputStreamReader(conexion.getInputStream()));
String linea;
while ((linea = reader.readLine()) != null) {
System.out.println(linea);
}
reader.close();// cerrar flujo
} catch (MalformedURLException me) {
System.err.println("MalformedURLException: " + me);
} catch (IOException ioe) {
System.err.println("IOException:  " + ioe);
}
}// main
}

CATEGORÍAS

Java

ETIQUETAS

.NET, HTTP, IOException, Java, Jesús Niño, Jesús Niño Camazón, System.out.println

MÁS

  • Usar XML:DB API para ejecutar una consulta de base de datos con XQuery en el servidor eXist-db
  • Cargar de forma sencilla un contenido JSON en Android
  • Ejecutar en Java un cmdlet de PowerShell en Base64
  • Enviar una imagen entre un cliente y un servidor con Java (Sockets TCP)
  • Instalación de software libre y propietario (Implantación de sistemas operativos)
  • Programación de documentos Web utilizando lenguajes de «script» de servidor (Implantación de aplicaciones web)
646336328 645341953 625159817 697945756 628625696 672419747 608374633 641010825 646994693 668413338 698333636 647510635 630046079 694455585 685708688 610106297 654068850 619293856 679588045 635204647 692368537 667394352 667787656 667147543 604539187 654069161 651439553 660017598 644512632 693661059 649323349 601476678 601147507 617782097 676478790 676395471 609024552 694976723 618263098 668120882 612994669 603623325 695893508 653196670 631721562 666918944 688258543 655205344 659329923 666633387 667485882 649036307 655767069 665222497 673642707 615545066 677755261 664501953 688290718 620858172 685553896 653678433 691005437 686860836 663692550 679951682 676650501 647876417 642434264 692921566