Coder Social home page Coder Social logo

Comments (6)

Delvinlim avatar Delvinlim commented on September 2, 2024 1

i manage to fix this, it was on the library itself where we push fix application/json content-type headers
you guys can modify the code to use multipart/form-data and apply some modification on image processing using Pillow library

from python-shopee.

tjengbudi avatar tjengbudi commented on September 2, 2024

@gr3yw0rm have you solved it?

from python-shopee.

plk3314 avatar plk3314 commented on September 2, 2024

I'm getting the same error as you, is there any other solution?
I'm testing in php, not python.

from python-shopee.

IDEALdream avatar IDEALdream commented on September 2, 2024

I'm getting the same error as you, is there any other solution? I'm testing in php, not python.

have you solved it?

from python-shopee.

IDEALdream avatar IDEALdream commented on September 2, 2024

Has anyone successfully uploaded an image in the media space? Shopee's API doc is currently vague and incomplete. I've tried posting with the image's URL and binary code (see sample code below). Even the api test tool is showing the same error message.

Code 1:

headers = {'Content-Type': 'application/json'}
url = "https://partner.test-stable.shopeemobile.com/api/v2/media_space/upload_image?partner_id=%s&shop_id=%s&timestamp=%s&access_token=%s"
body = {'image': 'https://cdn.shopify.com/s/files/1/0361/1738/1164/products/bcb5f0e09d312e2d849b3299ea2af01a.jpg?v=1619836687'}
response = requests.post(url, json=body, headers=headers)

Code 2:

headers = {'Content-Type': 'image/jpeg'}
url = "https://partner.test-stable.shopeemobile.com/api/v2/media_space/upload_image?partner_id=%s&shop_id=%s&timestamp=%s&access_token=%s"
body = {'media': open('test.jpg', 'rb')}
response = requests.post(url, files=body, headers=headers)

print(response) {'error': 'prodct.error_param', 'message': "can't find image file", 'warning': '', 'request_id': '354d1e0b625c3db6f2c12e25196dcb1c'}

have you solved it?

from python-shopee.

raoulalwani avatar raoulalwani commented on September 2, 2024

Has anyone managed to get this to work? Are they expecting an image URL or a blob? Getting an error as follows:

{"error"=>"product.error_param", "message"=>"form not found in request : form not found in request"}

from python-shopee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.