Hi
I have this little piece of server code running on Basic Python 3 environment:
R = anvil.http.request(url=URL,
method="POST",
data=PARAMS_0, json=True)
I get the error
HttpErrorStatus: Invalid JSON in response
at /libanvil/anvil/http.py, line 51
In order to debug I modify to:
R = anvil.http.request(url=URL,
method="POST",
data=PARAMS_0)
DATA = R.get_bytes()
print(DATA)
and get the printout:
b'{"error":{"code":"readapidenied","info":"You need read permission to use this module.","*":"See https://mywiki.myhost.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."}}'
With Postman, too:
{
"error": {
"code": "readapidenied",
"info": "You need read permission to use this module.",
"*": "See https://mywiki.myhost.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
}
}
That looks like valid JSON to me.
What’s wrong?
Thanks and BR