uCosminexus Application Server, Web Service Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
hasEntity() method
Description
This method checks whether an entity exists.
Syntax
public boolean hasEntity()
Parameter
Return value
The method returns true if an entity exists in the HTTP response.
Notes
- The method returns false if an HTTP response is acquired with an HTTP HEAD request.
- The method returns true if HttpURLConnection returns a number greater than 0 or -1 as the value of the Content-Length HTTP header. The method returns false if HttpURLConnection returns any other value.
- Generally, HttpURLConnection returns an integer greater than 0 if the encoding is not a chunked transfer encoding and an entity exists in the HTTP response, and -1 if the encoding is a chunked transfer encoding. For details on chunked transfer encoding, see RFC 2616.
- In the following cases, the operations are not guaranteed because the HTTP response is invalid:
- If the encoding is a chunked transfer encoding and the HTTP response contains the Content-Length HTTP header
- If the encoding is not a chunked transfer encoding and the value of the Content-Length HTTP header is not an appropriate value based on the HTTP response entity.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.