These are chat archives for WP-API/node-wpapi

3rd
Jul 2017
ajv
@andreasvirkus
Jul 03 2017 07:40
@c1n1k
media
  wp.media(): get a collection of media objects (attachments)
  wp.media().id( n ): get media object with ID n
Also look into embedding data so you'd have the attachments listed under post (wp:attachment)
https://github.com/WP-API/node-wpapi/#embedding-data
Oleg
@c1n1k
Jul 03 2017 10:06
@andreasvirkus sorry, but i don't understand how use embed. In the result on request hasn't "_embedded": {
ajv
@andreasvirkus
Jul 03 2017 10:10
at the end of your posts request append .embed()
that creates the _embedded property
Oleg
@c1n1k
Jul 03 2017 10:12
i try wp.posts().id(item.id).embed()
.then(result => {
console.log(result);
})
but nothing
ajv
@andreasvirkus
Jul 03 2017 10:45

that's all the help I know to provide based on node-wpapi docs : /
maybe @kadamwhite can chime in.

A quick search tells me that 415 could be an issue with the request's contentType (ie a missing or excessinve charset=utf8)
as mentioned here https://stackoverflow.com/questions/22566433/http-415-unsupported-media-type-error-with-json