Attempting to use the Roblox API to upload images

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to use the Roblox API to upload a image from my computer.

  2. What is the issue? Include screenshots / videos if possible!
    I am getting the error: “Make sure what you’re uploading is an image!”.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have looked everywhere, but can not find anything. I have tried using a different file format, changing the asset type ID to Image but nothing works.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

 xsrf = getXsrf()
print(xsrf)
with open('img.jpg', 'rb') as f:
  req = requests.post('https://data.roblox.com/data/upload/json?assetTypeId=13&name="Decal"&description="Test"', headers={
    'Content-Type': 'application/xml',
    'User-Agent': userAgent,
    'x-csrf-token': xsrf
  }, cookies={
    '.ROBLOSECURITY': cookie
  }, files={'img.jpg': f})
  print(req.text)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.