英文:
Validation error when attempting to upload an image with postman via printify api upload image endpoint
问题
我正在尝试使用Postman上传图像,使用Printify的上传图像终端点,但是我收到一个错误消息,说这些字段是必需的。身份验证令牌肯定有效,因为其他GET请求都正常返回,这可能是一个简单的修复,因为我对这方面还不太了解,请查看下面的图像以获取更多详细信息。谢谢!!
我尝试发布一张图像,期望得到正确的响应,但却收到了验证错误。
英文:
I am attempting to upload an image with postman using printify's upload image endpoint, however I am getting an error message saying these fields are required. The authentication token is definitely working as other GET request are returning fine, it's probably a simple fix as I'm new to this stuff but please see the image below for more details. Thanks!!
I tried to post an image expecting a correct response, but got a validation error instead
答案1
得分: 0
你正在连接到一个期望传入的POST请求以JSON格式包含信息的端点。但根据你的Postman屏幕截图,似乎你正在提供表单编码的数据作为信息。如果你发送一个以JSON字典形式提供数据字段的有效负载,我期望你会获得更好的结果。
查看API文档:https://developers.printify.com/#uploads。它提供了如何调用相关端点的清晰示例。
英文:
You are connecting to an endpoint that expects the incoming POST request to contain information in JSON format. But from your Postman screen dump, it appears that you are providing the information as form-encoded data. If you send a payload that provides your data fields in a JSON dictionary, I expect you'll have better results.
Take a look at the docs for the API: https://developers.printify.com/#uploads. It provides a clear example of how to make the call to the endpoint in question.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论