【发布时间】:2012-09-03 13:50:55
【问题描述】:
通过 HTTP 客户端使用 POST,我们在使用我们创建的私有应用通过 Shopify API 向我们的商店添加一些重定向时遇到了一些麻烦。
https://apikey:password@hostname/admin/redirects.xml
我们收到 HTTP/1.1 400 错误请求,错误如下:
<error>Extra content at the end of the document</error>
已尝试从 Shopify API 输入示例代码:http://api.shopify.com/redirect.xml.html#create
POST /admin/redirects.xml HTTP/1.1
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<redirect>
<path>/ipod</path>
<target>/pages/itunes</target>
</redirect>
如果我们一次做一个重定向,如果我们有多个,那么它会失败,你如何批量重定向?
【问题讨论】:
-
有没有返回错误?您是否将内容类型设置为 XML?
-
错过了 Content-Type 它现在适用于单个实例...。如果我尝试添加超过 1 个重定向,我会收到错误请求错误
文档末尾的额外内容
标签: shopify