RoyZeng / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

update operation returns HTTP code 200 instead of 204 #263

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Send a PUT request to update an entity. 

What is the expected output? What do you see instead?
expected HTTP code 204 (no content). Instead the returned code is 200 (with 
empty string body entity)

What version of the product are you using? 
odata4j core/jersey 0.7, windows, tomcat 7.40, jersey 1.17

The faulty class is org.odata4j.producer.resources.EntityRequestResource.java
method: updateEntity
There's even a comment inside for that, but the returned code is still faulty 
one for that operation.
The specification is clear about update operations with PUT: 
http://www.odata.org/documentation/odata-v2-documentation/operations/#26_Updatin
g_Entries (or am I missing something?):
"When processing a PUT request servers return status 204 (No Content) to 
indicate success, no response body is needed."

There's a negative effect on the interoperability of odata4j due to that 
non-compliance. Clients compliant with the specification will not be able to 
perform a proper update.

Original issue reported on code.google.com by sthra...@gmail.com on 2 Jul 2013 at 4:18