Jakarta problem

Discussion in 'Java' started by slippymississippi@yahoo.com, Mar 23, 2006.

  1. Guest

    I have this document that I would like to send via HTTP Post. However,
    the receiving application expects the content data to be sent as a
    parameter... and the content data can be hundreds of megabytes large.

    Does there exist an HTTP Client tool that allows you to stream the post
    request, rather than loading the request into memory up front?
     
    , Mar 23, 2006
    #1
    1. Advertising

  2. Oliver Wong Guest

    <> wrote in message
    news:...
    >
    > I have this document that I would like to send via HTTP Post. However,
    > the receiving application expects the content data to be sent as a
    > parameter... and the content data can be hundreds of megabytes large.


    When you say "as a parameter", do you mean GET? If so, you may be out of
    luck. I believe there's a limit on the length of an HTTP URL.

    - Oliver
     
    Oliver Wong, Mar 24, 2006
    #2
    1. Advertising

  3. Guest

    > When you say "as a parameter", do you mean GET?

    No, POST. I'm assuming that Jakarta knows enough about post to bury
    any huge parameter value in the body of the post, right?
     
    , Mar 24, 2006
    #3
  4. Roedy Green Guest

    On 24 Mar 2006 09:46:06 -0800, wrote,
    quoted or indirectly quoted someone who said :

    >No, POST. I'm assuming that Jakarta knows enough about post to bury
    >any huge parameter value in the body of the post, right?


    with post, all parameters go in the body.

    Various sites, e.g. webring, Opera, let you upload photos. You might
    sniff what is going on there to use as a model.

    see http://mindprod.com/jgloss/sniffer.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Mar 24, 2006
    #4
  5. Oliver Wong Guest

    <> wrote in message
    news:...
    >> When you say "as a parameter", do you mean GET?

    >
    > No, POST. I'm assuming that Jakarta knows enough about post to bury
    > any huge parameter value in the body of the post, right?


    Okay, so when you say "I have this document that I would like to send
    via HTTP Post. However, the receiving application expects the content data
    to be sent as a parameter", why the "however"? What's preventing you from
    simply using POST?

    - Oliver
     
    Oliver Wong, Mar 24, 2006
    #5
  6. Guest

    > What's preventing you from simply using POST?

    "... the content data can be hundreds of megabytes large."

    This is going to be a threaded application handling multiple requests,
    I don't think loading up Java String objects with several hundred
    megabytes, and passing them into a PostMethod object using Jakarta's
    addParameter method is going to fly.
     
    , Mar 24, 2006
    #6
  7. Oliver Wong Guest

    <> wrote in message
    news:...
    >> What's preventing you from simply using POST?

    >
    > "... the content data can be hundreds of megabytes large."
    >
    > This is going to be a threaded application handling multiple requests,
    > I don't think loading up Java String objects with several hundred
    > megabytes, and passing them into a PostMethod object using Jakarta's
    > addParameter method is going to fly.


    I looked all over http://jakarta.apache.org/httpcomponents/index.html
    and couldn't find an API reference, so I don't know what's available to you.
    If I were doing this, I'd do it manually, forming the HTTP request header,
    sending it to the socket, then maybe read 1024 bytes a at time from the
    file, send that through the socket, read another 1024 bytes, send it, and so
    on.

    If Jakarta really "forces" you pre-load the entire file in memory, and
    if that goes against your requirements, I guess you have no choice but to
    dump Jakarta; at least for this particular feature.

    - Oliver
     
    Oliver Wong, Mar 24, 2006
    #7
  8. Guest

    > I looked all over

    Yeah, I thought it was kinda wacky that they hide the javadocs from
    you. You have to drill down into the developer's section to get to the
    javadocs, IIRC.

    Thanks!
     
    , Mar 24, 2006
    #8
  9. Oliver Wong Guest

    Oliver Wong, Mar 24, 2006
    #9
  10. Roedy Green Guest

    Roedy Green, Mar 24, 2006
    #10
  11. Oliver Wong Guest

    "Roedy Green" <> wrote in
    message news:...
    > On Fri, 24 Mar 2006 19:54:18 GMT, "Oliver Wong" <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >>
    >> I looked all over http://jakarta.apache.org/httpcomponents/index.html
    >>and couldn't find an API reference,

    >
    > see http://jakarta.apache.org/commons/httpclient/apidocs/index.html


    Thanks. I see now the API for PostMethod, and its insistence of
    receiving pairs of strings as ("name","value) pairs that Slippy was
    complaining about.

    I took a look at the code at
    http://svn.apache.org/repos/asf/jak...g/apache/http/examples/ElementalHttpPost.java
    to see how they did things differently, and it looks like they are using the
    org.apache.http.message.HttpPost and org.apache.http.HttpEntity classes
    which don't see to be covered by the "org.apache.commons.httpclient" set of
    javadocs.

    - Oliver
     
    Oliver Wong, Mar 24, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. June Moore
    Replies:
    0
    Views:
    692
    June Moore
    Sep 18, 2003
  2. Alex Hunsley
    Replies:
    1
    Views:
    6,402
    Alex Hunsley
    May 28, 2004
  3. Barry
    Replies:
    1
    Views:
    2,581
  4. bb
    Replies:
    1
    Views:
    2,521
    glVertex
    Feb 7, 2012
  5. untung
    Replies:
    0
    Views:
    468
    untung
    Oct 7, 2009
Loading...

Share This Page