DavidWebb
DavidWebb copied to clipboard
Server response code 204
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();
Fixed the issue by changing the webservice to return an empty string. Still, I think DavidWebb should handle http code 204 correctly.
Thanks for doing the workaround. Of course you're right - this is indeed a bug. I'll fix this.