简体   繁体   English

尝试通过 printify api 上传图片端点上传带有 postman 的图片时出现验证错误

[英]Validation error when attempting to upload an image with postman via printify api upload image endpoint

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.我正在尝试使用 printify 的上传图像端点上传带有 postman 的图像,但是我收到一条错误消息,指出这些字段是必需的。 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.身份验证令牌肯定有效,因为其他 GET 请求返回正常,这可能是一个简单的修复,因为我是这个东西的新手,但请参阅下图了解更多详细信息。 Thanks!!谢谢!!

enter image description here在此处输入图像描述

I tried to post an image expecting a correct response, but got a validation error instead我试图发布一张图片,希望得到正确的回复,但却收到了验证错误

You are connecting to an endpoint that expects the incoming POST request to contain information in JSON format.您正在连接到一个端点,该端点期望传入的 POST 请求包含 JSON 格式的信息。 But from your Postman screen dump, it appears that you are providing the information as form-encoded data.但是从您的 Postman 屏幕转储来看,您似乎是以表单编码数据的形式提供信息。 If you send a payload that provides your data fields in a JSON dictionary, I expect you'll have better results.如果您发送的负载在 JSON 字典中提供您的数据字段,我希望您会得到更好的结果。

Take a look at the docs for the API: https://developers.printify.com/#uploads .查看 API 的文档: https://developers.printify.com/#uploads It provides a clear example of how to make the call to the endpoint in question.它提供了一个清晰的示例,说明如何调用相关端点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM