Advertisement
pasta_la_wista

editing headers

Aug 2nd, 2024
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import requests
  2. from vars import *
  3. username = 'alexdiscordbot'
  4. token = py_token
  5. domain = "alexdiscordbot.eu.pythonanywhere.com"
  6. static_url = "/static/russian.js"
  7. authorization_headers={'Authorization': 'Token {token}'.format(token=token)}
  8. url = f"https://www.pythonanywhere.com/api/v0/user/{username}/webapps/{domain}/static_headers/"
  9.  
  10. response = requests.post(
  11.     url=url,
  12.     headers=authorization_headers,
  13.     data={
  14.         "url": static_url,
  15.         "name": "Content-Type",
  16.         "value": "application/javascript; charset=utf-8"
  17.     }
  18. )
  19. print(response.json())
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement