Advertisement
Guest User

Untitled

a guest
Sep 5th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import json
  2. import requests
  3. from requests.auth import HTTPBasicAuth
  4.  
  5. base_url = "https://photoai.lotlinx.com"
  6. username = "testaccount8"
  7. password = "79b41e211568"
  8.  
  9. def RequestToken():
  10. endpoint = base_url + "/images/optimize"
  11. session = requests.Session()
  12. session.auth = (username, password)
  13. data = [{
  14. "dealerID": 54345,
  15. "vehicles": [{"id": 65, "images": [{"imageId": 43, "imageUrl": "https://img.lotlinx.com/vdn/7416/jeep_wrangler%20unlimited_2014_1C4BJWFG3EL326863_7416_5_339187295.jpg"}]}]
  16. }]
  17. resp = session.post(url=endpoint, data=data)
  18. return resp
  19.  
  20. r = RequestToken()
  21. print(r.json())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement