pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Vilar" <alejandro.vi...@synacom.com.bo>
Subject Web queries (No content response)
Date Tue, 27 Apr 2010 14:23:16 GMT
Hi, I have a query for a rest server which response code is 204, but I have
an exception while the response is processed in this section:

 

Class: org.apache.pivot.web.Query

 

           // Read the response body

            if (method == Method.GET) {

                InputStream inputStream = null;

                try {

                    inputStream = connection.getInputStream();

                    value = serializer.readObject(new
MonitoredInputStream(inputStream));//├čexception

                } finally {

                    if (inputStream != null) {

                        inputStream.close();

                    }

                }

            }

And that's because I get a response without content, any way the above code
is trying to read the response body and getting the serialized content, as
the response code description says "there is no content" maybe this process
should be avoided. I can fix it using a empty serializer, but maybe it would
be useful a method such as Query.doNotProcessResponseBody(), or a switch for
each type of response code or do not read the content until is required(some
kind of cache(?)).

 

What you think?

 

Regards,

Alejandro

 

 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5> HTTP RFC
- 10.2.5 204 No Content 

 


Mime
View raw message