haskell-telegram-api icon indicating copy to clipboard operation
haskell-telegram-api copied to clipboard

use POST requests with ReqBody

Open quyse opened this issue 7 years ago • 1 comments

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.

quyse avatar Feb 14 '18 10:02 quyse

Probably it was broken in 9cf9985b6c457974461c54efbf39edc0fbceabbc, when QueryParams were replaced with ReqBody but Get wasn't changed to Post.

quyse avatar Feb 14 '18 10:02 quyse