So I'm in a bit over my head here. I can GET information from my Wordpress site using httr:
For instance, to get the details of post ID 141, I use this:
ws = GET("https://example.com/wp-json/wp/v2/posts/141")
Works fine because the authentication is through cookies I think, and I'm logged into my Wordpress site.
But I can't POST to my wordpress site because (I think) the cookie-type authorization is not allowed.
So this returns a 401 error:
POST ('example.com/wp-json/wp/v2/posts/141',
body = list(title = "My New Title"))
I think I need to send an authorization header, but I'm not sure how to set that up.