haskell-telegram-api
haskell-telegram-api copied to clipboard
use POST requests with ReqBody
Currently getUpdates
method ignores all input parameters, such as offset
and timeout
, so it's basically impossible to fetch updates (it returns the same updates over and over again). Seems like using GET HTTP method with request body is the problem. I'm not sure whether servant
doesn't send request body data within GET request, or that request data is simply ignored in GET requests by Telegram servers. Anyway, changing HTTP method to POST fixes the problem.
I changed setWebhook
method to POST as well (I didn't test it, as I don't use webhooks). All other requests in the library already use POST if ReqBody
is present.
Probably it was broken in 9cf9985b6c457974461c54efbf39edc0fbceabbc, when QueryParam
s were replaced with ReqBody
but Get
wasn't changed to Post
.