Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Jakarta problem

Reply
Thread Tools

Jakarta problem

 
 
slippymississippi@yahoo.com
Guest
Posts: n/a
 
      03-23-2006

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?

 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      03-24-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>
> 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

 
Reply With Quote
 
 
 
 
slippymississippi@yahoo.com
Guest
Posts: n/a
 
      03-24-2006
> 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?

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-24-2006
On 24 Mar 2006 09:46:06 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      03-24-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>> 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

 
Reply With Quote
 
slippymississippi@yahoo.com
Guest
Posts: n/a
 
      03-24-2006
> 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.

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      03-24-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>> 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

 
Reply With Quote
 
slippymississippi@yahoo.com
Guest
Posts: n/a
 
      03-24-2006
> 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!

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      03-24-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>> 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.


See
http://svn.apache.org/repos/asf/jaka...lHttpPost.java

You can provide an InputStream to the request. So provide a
FileInputStream.

- Oliver

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-24-2006
On Fri, 24 Mar 2006 19:54:18 GMT, "Oliver Wong" <(E-Mail Removed)>
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/ht...ocs/index.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jakarta Commons-Validator config. problem bb Java 1 02-07-2012 04:24 AM
Lowongan : Web Programmer / Developer (Jakarta Raya Jakarta Pusat) untung Java 0 10-07-2009 01:22 PM
FTP connect problem with Jakarta Commons Net package Barry Java 1 01-15-2005 05:35 AM
problem setting proxy credentials in Jakarta HttpClient 2.0 Alex Hunsley Java 1 05-28-2004 03:02 PM
Jakarta Tomcat Manager - Problem with redeploy war file June Moore Java 0 09-18-2003 10:37 AM



Advertisments