DavidWebb icon indicating copy to clipboard operation
DavidWebb copied to clipboard

Server response code 204

Open svrolanski opened this issue 8 years ago • 2 comments

Using webb 1.3. I'm doing a PUT request to a restful webservice using 2-way compression. The server is returning code 204, which is successful request ("No content"). But the response is empty (as it should be); WebbException: EOFException is being thrown because Webb is trying to decompress an empty response.

this is my code: Response<Void> response = webb.put("descarga") .header(Webb.HDR_CONTENT_TYPE, Webb.APP_JSON) .body(byteArrayOutputStream.toByteArray()) .compress() .connectTimeout(Config.Webservice.getTimeout()) .retry(1, false) .ensureSuccess() .asVoid();

svrolanski avatar Jan 03 '17 18:01 svrolanski

Fixed the issue by changing the webservice to return an empty string. Still, I think DavidWebb should handle http code 204 correctly.

svrolanski avatar Jan 03 '17 19:01 svrolanski

Thanks for doing the workaround. Of course you're right - this is indeed a bug. I'll fix this.

hgoebl avatar Jan 04 '17 08:01 hgoebl