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

NetworkResponse Error Managing #36

Closed
allanserre opened this issue May 3, 2021 · 3 comments
Closed

NetworkResponse Error Managing #36

allanserre opened this issue May 3, 2021 · 3 comments

Comments

@allanserre
Copy link

When i get a "204 No content" response from my API , NetWorkResponse consider it as a server error. But it should be a SUCCESS response. As describe in the ReadMe a response code 2xx is consider as successfull.

@haroldadmin
Copy link
Owner

If your API response contains no body, please use Unit as the success body type.

interface DocsApi {
  @Get("/docs")
  suspend fun getDocs(): NetworkResponse<Unit, ErrorType>
}

This has been documented here.

@allanserre
Copy link
Author

allanserre commented May 4, 2021

Thank for your answer , looks like i'm a bad reader

@haroldadmin
Copy link
Owner

I think it just means that docs need to be better 😅

This was referenced May 11, 2021
Closed
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