Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server response code 204 #26

Open
svrolanski opened this issue Jan 3, 2017 · 2 comments
Open

Server response code 204 #26

svrolanski opened this issue Jan 3, 2017 · 2 comments

Comments

@svrolanski
Copy link

svrolanski commented Jan 3, 2017

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
Copy link
Author

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

@hgoebl
Copy link
Owner

hgoebl commented Jan 4, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants