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

17th
May 2017
ajv
@andreasvirkus
May 17 2017 11:44
@mnivoliez what are you trying to request? a page/post?
mnivoliez
@mnivoliez
May 17 2017 11:55

I'm trying to request post. But I assume it should work the same for page. I use polylang (which does not add anything to the api). I discovered that if in the header of the request we specify the "Accept-language", it return the wanted locale of the post. Maybe being hable to modify a WPRequest headers like

site.posts().setHeader("Accept-language", "en-US").get()

could be a good way to do so.

K Adam White
@kadamwhite
May 17 2017 21:49
@mnivoliez I have just submitted a new PR that implements precisely that API (well, setHeaders, but very close!) — I’d love your thoughts on the PR if you have a moment! WP-API/node-wpapi#315
It seems like a useful thing to add, thank you for the suggestion