Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > access HTTP payload in Java

Reply
Thread Tools

access HTTP payload in Java

 
 
zhengyu
Guest
Posts: n/a
 
      02-11-2004
Hi, I am looking for ways to access HTTP payload, i.e. HTTP message stripped
of the header.
I searched thru various classes under Java.net, but could not find anything
that fits what
I have mind. I was expecting to be able to retrieve the HTTP body in a
single byte array, or something
similar. Is my expectation correct??

Cheers,
Jimmy


 
Reply With Quote
 
 
 
 
Andy Fish
Guest
Posts: n/a
 
      02-11-2004
if you are on the server and writing a servlet, just use getInputStream

if you are writing an HTTP client, try using the jakarta commons http client
package.

"zhengyu" <(E-Mail Removed)> wrote in message
news:F_jWb.3779$uV3.12595@attbi_s51...
> Hi, I am looking for ways to access HTTP payload, i.e. HTTP message

stripped
> of the header.
> I searched thru various classes under Java.net, but could not find

anything
> that fits what
> I have mind. I was expecting to be able to retrieve the HTTP body in a
> single byte array, or something
> similar. Is my expectation correct??
>
> Cheers,
> Jimmy
>
>



 
Reply With Quote
 
 
 
 
Jimmy Zhang
Guest
Posts: n/a
 
      02-11-2004
Is it possible to retrieve the byte from the input stream into a large byte
array?
Thanks,
Jimmy
"Andy Fish" <(E-Mail Removed)> wrote in message
news:g%lWb.1747$(E-Mail Removed)...
> if you are on the server and writing a servlet, just use getInputStream
>
> if you are writing an HTTP client, try using the jakarta commons http

client
> package.
>
> "zhengyu" <(E-Mail Removed)> wrote in message
> news:F_jWb.3779$uV3.12595@attbi_s51...
> > Hi, I am looking for ways to access HTTP payload, i.e. HTTP message

> stripped
> > of the header.
> > I searched thru various classes under Java.net, but could not find

> anything
> > that fits what
> > I have mind. I was expecting to be able to retrieve the HTTP body in a
> > single byte array, or something
> > similar. Is my expectation correct??
> >
> > Cheers,
> > Jimmy
> >
> >

>
>



 
Reply With Quote
 
Jimmy Zhang
Guest
Posts: n/a
 
      02-11-2004
Sorry, my real question is that if there is a way to access the underlying
buffers of the input stream object instead of
allocating then copying to another piece of memory.
Also does the input stream give access to headers or only to the
payload/body?

Thanks,
Jimmy
Also is there a way to
"Jimmy Zhang" <(E-Mail Removed)> wrote in message
news:5PwWb.9284$_44.11630@attbi_s52...
> Is it possible to retrieve the byte from the input stream into a large

byte
> array?
> Thanks,
> Jimmy
> "Andy Fish" <(E-Mail Removed)> wrote in message
> news:g%lWb.1747$(E-Mail Removed)...
> > if you are on the server and writing a servlet, just use getInputStream
> >
> > if you are writing an HTTP client, try using the jakarta commons http

> client
> > package.
> >
> > "zhengyu" <(E-Mail Removed)> wrote in message
> > news:F_jWb.3779$uV3.12595@attbi_s51...
> > > Hi, I am looking for ways to access HTTP payload, i.e. HTTP message

> > stripped
> > > of the header.
> > > I searched thru various classes under Java.net, but could not find

> > anything
> > > that fits what
> > > I have mind. I was expecting to be able to retrieve the HTTP body in a
> > > single byte array, or something
> > > similar. Is my expectation correct??
> > >
> > > Cheers,
> > > Jimmy
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Andy Fish
Guest
Posts: n/a
 
      02-12-2004
the inputstream object gives access to the body only. there are other
methods on the request object to access the header fields

I don't think you can directly access the buffers of the underlying input
stream - you would need to read or copy it using the normal java mechanisms
for processing input streams. apart from a marginal increase in performance
I don't see why you would want to do this anyway.

Andy

"Jimmy Zhang" <(E-Mail Removed)> wrote in message
news:U1xWb.274016$I06.2929562@attbi_s01...
> Sorry, my real question is that if there is a way to access the underlying
> buffers of the input stream object instead of
> allocating then copying to another piece of memory.
> Also does the input stream give access to headers or only to the
> payload/body?
>
> Thanks,
> Jimmy
> Also is there a way to
> "Jimmy Zhang" <(E-Mail Removed)> wrote in message
> news:5PwWb.9284$_44.11630@attbi_s52...
> > Is it possible to retrieve the byte from the input stream into a large

> byte
> > array?
> > Thanks,
> > Jimmy
> > "Andy Fish" <(E-Mail Removed)> wrote in message
> > news:g%lWb.1747$(E-Mail Removed)...
> > > if you are on the server and writing a servlet, just use

getInputStream
> > >
> > > if you are writing an HTTP client, try using the jakarta commons http

> > client
> > > package.
> > >
> > > "zhengyu" <(E-Mail Removed)> wrote in message
> > > news:F_jWb.3779$uV3.12595@attbi_s51...
> > > > Hi, I am looking for ways to access HTTP payload, i.e. HTTP message
> > > stripped
> > > > of the header.
> > > > I searched thru various classes under Java.net, but could not find
> > > anything
> > > > that fits what
> > > > I have mind. I was expecting to be able to retrieve the HTTP body in

a
> > > > single byte array, or something
> > > > similar. Is my expectation correct??
> > > >
> > > > Cheers,
> > > > Jimmy
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
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
IPSEC: reserved not zero on payload message when connecting site-to-site Arjan Cisco 2 10-13-2005 06:37 PM
5350 can't use G711 payload type for fax pass-through?? Greg Cisco 2 04-05-2005 01:53 PM
How can I get text of the body (payload) of an email? andrew blah Python 6 10-16-2004 10:49 PM
Any problems with SIP phones not identifying payload sizes? CCGolfer VOIP 0 06-08-2004 08:44 PM
JMF: encrypting rtp payload junaid Java 0 12-30-2003 07:05 PM



Advertisments