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

Getting HTTP 202 all the time for /v0/count api #775

Open
assayire opened this issue Nov 14, 2024 · 4 comments
Open

Getting HTTP 202 all the time for /v0/count api #775

assayire opened this issue Nov 14, 2024 · 4 comments

Comments

@assayire
Copy link

I am trying this request, and I have been always getting HTTP 202 response. Can someone tell me what I am missing or doing wrong?

curl --request POST \
  --url https://my-domain.goatcounter.com/api/v0/count \
  --header 'Authorization: Bearer <my-token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "no_sessions": true,
  "hits": [
    {
      "path": "<path/to/page>"
    }
  ]
}'
@arp242
Copy link
Owner

arp242 commented Nov 14, 2024

Do you have any X-Goatcounter in the response? If there's an error, it should put the message in there.

@vivekragunathan
Copy link

No, I don't see it in the response

HTTP/1.1 202 Accepted
Age
0
Cache-Control
no-store,no-cache
Connection
close
Content-Security-Policy
manifest-src 'self' https://gc.zgo.at static.zgo.at; frame-ancestors 'none'; default-src 'none'; script-src 'self' https://gc.zgo.at static.zgo.at; style-src 'self' https://gc.zgo.at static.zgo.at 'unsafe-inline'; font-src 'self' https://gc.zgo.at static.zgo.at; form-action 'self'; connect-src 'self' wss:; frame-src 'self'; img-src 'self' https://gc.zgo.at static.zgo.at data:
Content-Type
text/plain; charset=utf-8
Date
Thu, 14 Nov 2024 11:38:45 GMT
Transfer-Encoding
chunked
Vary
Accept-Encoding
Via
1.1 www (Varnish/7.5)
X-Rate-Limit-Limit
60
X-Rate-Limit-Remaining
60
X-Rate-Limit-Reset
120
X-Varnish
20269760562

{"status":"ok"}

@assayire
Copy link
Author

Tried a few different ways .. the API always return 202.

There is also one more issue I am facing. My site is built using Hugo. Hugo adds trailing slashes in the url, which when capturing for views Goat counts without /. But when querying stats, / is considered, and page views is always zero.

@vivekragunathan
Copy link

The relevant GET api returns the correct count even though this API returns 202.

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

3 participants