[03:39:16] Hello, I cannot Login Wikipedia using Curl command [03:41:07] I used the following to obtain login credentials [03:41:13] curl -v -c "cookies.txt" -b "cookies.txt" "https://bn.wikipedia.org/w/api.php?action=query&meta=tokens&type=login&format=json" -o "credentials.json" [03:41:45] This goes fine and I get my login token [03:43:44] Then I use v [03:44:07] curl -v -b "cookies.txt" -c "cookies.txt" -X POST --data 'action=login&lgname=MyUserName&lgpassword=MyPass&lgtoken=\&format=json' -o "b.html" https://bn.wikipedia.org/w/api.php [03:44:32] But it returns the HTML page of the documenation [03:45:03] I expected a JSON response (login failed or passed) [03:52:36] !help [04:05:44] !help [09:18:19] Well if you exclude the +\ of course it won't work... [10:34:18] !help [10:36:47] With? [10:36:57] Also don't do in multiple channels at once [10:37:21] nokib: 10:18:20 Well if you exclude the +\ of course it won't work... [10:37:41] I did not know which is the channel I should consult with [10:37:52] Any is fine but stick to 1 [10:38:27] I included the /+ [10:38:31] If you're pushing as post data then it's json you probably want [10:38:43] Yes I am expecting json [10:38:50] Send it as json [10:38:59] I tried with json [10:38:59] Or use url parameters [10:39:05] But no luck [10:39:37] What errors? [10:40:17] curl -v -b "cookies.txt" -c "cookies.txt" -X POST --data 'action=login&lgname=MyUserName&lgpassword=MyPass&lgtoken=mytoken+\&format=json' -o "b.html" https://bn.wikipedia.org/w/api.php [10:40:42] No error is shown [10:41:07] I literally just said either use url parameters or send the data as json [10:41:10] I got the html version of the API Page [10:41:20] Because that's what you're requesting [10:41:42] try api.php?action=login&lgname=Blah etc etc [10:41:48] Instead of just api.php [10:42:00] Or actually send the data as json like you should be [10:44:23] curl -H "Content-Type: application/json" -D '{"action":"login","lgname":"Nokib Sarkar","lgpassword":"MyPass","lgtoken":"9b.......2930+\\"}' https://bn.wikipedia.org/w/api.php [10:44:41] Isn't it Correct [10:45:03] That looks better [10:45:14] But did not work [10:45:27] Event not getting any json at all [10:46:36] What output do you get from the api [10:46:51] The html page [10:47:19] Documentation page [10:48:02] Can you try using query string [10:48:12] But as an actual query string not as data [10:48:20] Like https://www.mediawiki.org/w/api.php?action=login&format=json&lgname=user&lgpassword=&lgtoken=123ABC [10:48:34] OK let me try