Comments (6)
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.
@gr3yw0rm have you solved it?
from python-shopee.
I'm getting the same error as you, is there any other solution?
I'm testing in php, not python.
from python-shopee.
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.
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×tamp=%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×tamp=%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.
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)
- Invalid Token when authorize URL
- open platform 2.0 HOT 2
- Information that can be edited in individual items HOT 14
- Test Shops HOT 1
- How to set a discount when listing an item HOT 2
- push mechanism
- Request feature - Test shop - 21-01-14 HOT 2
- shopee.Item.GetRecommendCats not found HOT 1
- getting code for token request HOT 1
- We want to include all mandatory attributes. HOT 2
- What is access token HOT 3
- Chat api not working
- How to use the interface of SHOPEE 2.0 HOT 3
- Hi, I have some question about token cached. HOT 2
- 無法使用api2.0
- I can't change item stocks HOT 1
- Good news. Especially for beginners.
- ConnectTimeout: How many requests per second are there? HOT 2
- About Chat API permission request.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-shopee.