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

Http Webhook only accepts 200 as OK, yet many databases will return 204 or 201 when they've successfully ingested the data #216

Open
jasestu opened this issue Jan 7, 2024 · 2 comments
Labels
to do list Features planed to be implemented

Comments

@jasestu
Copy link

jasestu commented Jan 7, 2024

Sorry if I'm not understanding things well, very new to this.
I'm working with the webhook api and have tried capturing the data via couchdb and telegraf > influxdb. Couchdb returns a 201 Created when it gets the data and telegraf a 204 No Content. It appears that CarStatsViewer treats these as failures and therefore says the manual upload is unsuccessful and keeps the API connection symbol red.

Should the other 200 series codes be considered as success, or do I need to try and change how these databases respond?

@jasestu
Copy link
Author

jasestu commented Jan 7, 2024

Ok, easy fix.

I just modified httplivedata.kt to treat 204 as good.

    if (responseCode != 200 && responseCode != 204) {
        InAppLogger.e("[HTTP] Transmission failed. Status code $responseCode")
        return ConnectionStatus.ERROR
    }

this solves for me for telegraf.

@Ixam97 Ixam97 added the to do list Features planed to be implemented label Jan 14, 2024
@Ixam97
Copy link
Owner

Ixam97 commented Jan 14, 2024

I will look a bit more into different response code to make the API more versatile for the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to do list Features planed to be implemented
Projects
None yet
Development

No branches or pull requests

2 participants