【问题标题】:Error while adding a Product In BigCommerce Store through API通过 API 在 BigCommerce 商店中添加产品时出错
【发布时间】:2016-07-25 21:29:00
【问题描述】:

我想通过 Bigcommerce API 在我们的 Bigcommerce 商店中添加产品。

我已使用以下 API 在我们的商店中添加产品:-

网址:https://store-f8tya.mybigcommerce.com/api/v2/products

类型:POST

数据:行 - json

{
    "name": "Plain T-Shirt",
   "type": "physical",
    "description": "This timeless fashion staple will never go out of style!",
    "price": "29.99",
    "categories": [21],
    "availability": "available",
    "weight": "0.5"
}

我收到以下错误:

415 - 指定的输入内容类型无效。

注意:我被要求输入用户名和密码。我从旧版 API 设置中输入了正确的用户名和令牌。

有人可以帮忙解决这个问题吗?

【问题讨论】:

  • 你有内容类型的标题吗?你需要指定是xml还是json。
  • 谢谢@Alyss。它起作用了.. :) (y) 你能在回答中提到它吗?所以,我可以接受它..

标签: api bigcommerce


【解决方案1】:

此错误是由于未指定内容类型标头。 BigCommerce 接受 XML 或 JSON 作为类型。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-15
    • 2021-04-21
    • 1970-01-01
    相关资源
    最近更新 更多