Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #23130

Re: POST to secure server

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!137.226.231.214.MISMATCH!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail
From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: POST to secure server
Date Tue, 26 Mar 2013 09:51:39 -0700
Organization A noiseless patient Spider
Lines 26
Message-ID <kisjiu$n4d$1@dont-email.me> (permalink)
References <c3c53dbd-b60d-4a93-95ea-d6bf653037aa@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 26 Mar 2013 16:49:35 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="fba3415ba68d85d643935af2f52f0b4b"; logging-data="23693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hGxUdoR3lMgQUdoO/eknzSHnqpfqzjok="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
In-Reply-To <c3c53dbd-b60d-4a93-95ea-d6bf653037aa@googlegroups.com>
Cancel-Lock sha1:37Em7BtfEy8Mf7YSwzg5mp7V87k=
Xref csiph.com comp.lang.java.programmer:23130

Show key headers only | View raw


On 3/26/2013 4:46 AM, RVic wrote:
> I have an application that must run in windows which must post to a
> servlet running on a secure server. I can WinSCP into that server,
> and I can use PuTTY to ssh into that server. But I am quite clueless
> how I can post to a servlet there?
...
 > out.write(sb.toString());
 > out.flush();

   out.close();

Generally speaking, you must close the TCP connection or the server 
won't "recognize" that you are done sending data.

I seem to recall that Java's built-in HttpConnection is kind of 
primitive and doesn't really implement everything you'd expect for a 
real HTTP connection.  In particular, I think you have to handle cookies 
yourself, which might be causing the server code to break if it doesn't 
see the cookies it's expecting.

I think the Apache Commons library has an HTTP class that handles things 
more automagically.  Try their HttpClient if you can't figure out what 
the built-in version needs:

<http://hc.apache.org/>

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

POST to secure server RVic <rvince99@hotmail.com> - 2013-03-26 04:46 -0700
  Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-26 13:43 +0000
  Re: POST to secure server markspace <markspace@nospam.nospam> - 2013-03-26 09:51 -0700
  Re: POST to secure server Roedy Green <see_website@mindprod.com.invalid> - 2013-03-26 19:00 -0700
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-27 05:34 -0700
    Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-27 13:07 +0000
    Re: POST to secure server Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-27 20:11 -0300
      Re: POST to secure server markspace <markspace@nospam.nospam> - 2013-03-27 19:38 -0700
      Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-28 08:49 +0000
        Re: POST to secure server Silvio <silvio@internet.com> - 2013-03-28 10:17 +0100
        Re: POST to secure server Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-28 06:19 -0300
          Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-28 09:54 +0000
            Re: POST to secure server Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-28 20:51 -0300
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-27 06:24 -0700
  Re: POST to secure server Silvio <silvio@internet.com> - 2013-03-27 14:37 +0100
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-27 06:45 -0700
    Re: POST to secure server Silvio <silvio@internet.com> - 2013-03-27 15:08 +0100
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-27 08:39 -0700
    Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-27 17:30 +0000
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-27 13:26 -0700
    Re: POST to secure server Silvio <silvio@internet.com> - 2013-03-28 10:05 +0100
    Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-28 10:34 +0000
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-03-28 05:02 -0700
    Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-28 12:22 +0000
  Re: POST to secure server RVic <rvince99@hotmail.com> - 2013-04-02 07:07 -0700
    Re: POST to secure server Silvio <silvio@internet.com> - 2013-04-02 22:39 +0200
    Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 10:39 +0100
      Re: POST to secure server Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 15:32 +0200
        Re: POST to secure server lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 15:34 +0100

csiph-web