🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #647

Re: XML y metodo POST

#647
From: Eduardo Yáñez Parareda
Date: Tue, 13 Feb 2007 08:36
23 lines
1684 bytes
     try {
         // Construct data
         String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
         data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");

         // Send data
         URL url = new URL("http://hostname:80/cgi");
         URLConnection conn = url.openConnection();
         conn.setDoOutput(true);
         OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
         wr.write(data);
         wr.flush();

         // Get the response
         BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
         String line;
         while ((line = rd.readLine()) != null) {
             // Process line...
         }
         wr.close();
         rd.close();
     } catch (Exception e) {
     }
Technical Details
Message-ID: <53dbraF1rq23lU1@mid.individual.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <eqqnab$96c$1@hefestos.uned.es>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,1df2015c13be783b
X-Google-Attributes: gid1116f3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Eduardo Yáñez Parareda
 <eduardo.yanezNOSPAM@NOSPAMgmail.com>
Newsgroups: es.comp.lenguajes.java
Subject: Re: XML y metodo POST
Date: Tue, 13 Feb 2007 09:36:20 +0100
Lines: 23
Message-ID: <53dbraF1rq23lU1@mid.individual.net>
References: <eqqnab$96c$1@hefestos.uned.es>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net seAFcK4ZvcneGEGEp3/v3g3WxxmEJysoScebEoP0xQg77vR5oG
User-Agent: Thunderbird 1.5.0.9 (X11/20070130)
In-Reply-To: <eqqnab$96c$1@hefestos.uned.es>