Jump to content

Topic on Project:Support desk

clientlogin-Request fails with "missingparam" with parameter provided

2
2A02:810D:4940:1C4:D9A:BF2B:364F:D8C8 (talkcontribs)

Hello everyone. I am trying to make a post request to the mediawiki api with the following url

https://test.domain.de/w/api.php?action=clientlogin&format=json

with my body looking like this

{"logintoken":"e55e353a054628b573a515a6580fa4ed66a235a4%2B%5C","username":"test","password":"test"}

I got the login-token via the get-request https://test.domain.de/w/api.php?action=query&meta=tokens&type=login&format=json

Content-Type is application/json in both instances

and I am getting the following error with the latter post request

{"error":{"code":"missingparam","info":"The \"logintoken\" parameter must be set.","*":"See https://testwiki.sevengamer.de/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."}}


This does not make sense to me given as i am providing the parameter that the response is telling me is missing. Please help :(

Bawolff (talkcontribs)

Application/json is not a supported content type by the api. Use either multipart/form-data or application/x-www-form-urlencoded for post bodies (and make them in that format)

Reply to "clientlogin-Request fails with "missingparam" with parameter provided"