how do I log in with a python script?

comments (single view)

no, you need to provide the token returned as an Authorization header in future requests

Can you give an example?

// js
fetch(`https://api.wasteof.money`, { headers: { Authorization: <TOKEN>}})

this is untested but should work:

requests.post("https://api.wasteof.money", headers={ Authorization: <TOKEN> })

this will make a post:

import requests

authJson = {"Authorization": "my token"}

post = requests.post("https://api.wasteof.money/posts", headers = authJson, json = {"post": "api test"})

or to get your token:

import requests
requests.get("https://wasteof.money/session", json={"username": "user", "password": "password"})
View all comments