【发布时间】:2017-09-25 12:21:42
【问题描述】:
我正在尝试使用 WP API v2 (WP 4.7.3) 发出发布/上传新媒体的请求。我正在使用 Node 客户端 (https://github.com/WP-API/node-wpapi) 来处理这个问题。
由于我只收到错误 400 rest_upload_no_data,因此我正在尝试查找执行此操作所需的字段。
我在做什么:
wp.media()
.file( uri )
.create({
title: 'My awesome image',
alt_text: 'an image of something awesome',
caption: 'This is the caption text',
description: 'More explanatory information',
status: 'publish'
})
.then(function( response ) {
...
我查看了文档 (https://developer.wordpress.org/rest-api/reference/media/),但看不到需要或不需要哪个参数。
有什么帮助吗?
【问题讨论】:
标签: wordpress wordpress-rest-api wp-api