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

May 2017
May 17 2017 11:44
@mnivoliez what are you trying to request? a page/post?
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
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