As it turns out, while the expected content-type is still application/json (though in practice it doesn't matter what you send), the actual expected contents are supposed to be application/x-www-form-urlencoded regardless, except in a few cases (direct messages and media uploads).
This patch modifies the post() and performPost() methods slightly: the former checks to see if the provided $path is in a known whitelist for JSON payloads, and passes the result on to performPost(). That method then varies how the payload is created and injected into the request accordingly.
As it turns out, while the expected content-type is still application/json (though in practice it doesn't matter what you send), the actual expected contents are supposed to be application/x-www-form-urlencoded regardless, except in a few cases (direct messages and media uploads).
This patch modifies the
post()
andperformPost()
methods slightly: the former checks to see if the provided$path
is in a known whitelist for JSON payloads, and passes the result on toperformPost()
. That method then varies how the payload is created and injected into the request accordingly.Fixes #48.