上传图像时,通过Postman使用Printify API上传图像端点出现验证错误。

huangapple go评论97阅读模式
英文:

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!!

enter image description here

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.

huangapple
  • 本文由 发表于 2023年1月9日 03:12:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75050588.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定