Hi,
I am using RestClient plug-in in FireFox to test my RESTful webservice
application. I am facing below problem while using "If-Modified-Since"
request header.
"Eventhogh I am not giving the If-Modified-Since header parameter explicitly
with the request I am getting some default value for this parameter and I am
getting '304 Not-Modified' response from the server instead of '200 OK' "
I analysed more and found that the default value coming as the value of
If-Modified-Since is equal to the Last-Modified Response heder.
See below the way I am retrieving the If-Modified-Since value from the
MessageContext object.
MessageContext context
.......
HttpHeaders headers = context.getHttpHeaders();
........
List<String> ifModifiedSince =
headers.getRequestHeader("If-Modified-Since");
if (ifModifiedSince != null && ifModifiedSince.size() > 0) {
transactionInformation.setIfModifiedSince(ifModifiedSince.get(0));
/* value of ifModifiedSince.get(0) : Sun, 05 Dec 2010 02:22:37 GMT ---->
Same as Last-Modified */
}
......
Please help me to resolve this problem.
Thanks,
Shinoj
|