API Example: Python: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

4 December 2024

  • curprev 16:4816:48, 4 December 2024Admin talk contribs 1,407 bytes +1,407 Created page with "<pre> import requests # URL and parameters for login login_url = 'https://dev.soylentnews.org/api.pl?m=auth&op=login' login_payload = { 'nick': 'replic8tor', 'pass': 'apassword' } # Post the JSON payload to the login URL response = requests.post(login_url, json=login_payload) print(response) # Check if the login request was successful if response.status_code == 200: # Extract the cookie from the response cookie = response.cookies.get_dict() print(f'..."