How to add attachment via REST API?
-
I see that the REST API is supported, but I don’t see any documentation on how to call it with attachments via javascript/json. Is there a tutorial somewhere? Currently, I’m creating comments anonymously with the following:
fetch(
${wordpressUrl}/wp-json/wp/v2/comments
, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
post: postId,
content: content,
author_name: authorName,
author_email: authorEmail,
author_url: authorUrl
})
})
.then (...)Thanks again for all you’re doing here, I know I’ve asked a bunch of questions as I just discovered your plugin!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.