Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Problem with documentation example? #283

Closed
Pezzab opened this issue Jun 2, 2014 · 2 comments
Closed

Problem with documentation example? #283

Pezzab opened this issue Jun 2, 2014 · 2 comments

Comments

@Pezzab
Copy link

Pezzab commented Jun 2, 2014

Hi, I'm just working through the documentation to get myself acquainted with the API (great documentation btw!) and I tried this in getting-started.md:

curl --data-binary="@updated-post.json" \ -H "Content-Type: application/javascript" \ --user admin:password \ http://example.com/wp-json/posts

After adapting the example to fit with my test site I kept getting the following error:

curl: option --data-binary="@update-post.json": is unknown

After some tinkering I found that removing the '=' from the example code (eg curl --data-binary "@updated-post.json") meant that the post request worked, though I did get the following response:

[{"code":"json_cannot_create","message":"Sorry, you are not allowed to post on this site."}]

@rmccue
Copy link
Member

rmccue commented Jun 2, 2014

Good catch with the cURL options there, we should definitely fix that.

We should also note that the examples require the Basic Auth plugin right now.

@rmccue rmccue added this to the 1.1 milestone Jun 2, 2014
@Pezzab
Copy link
Author

Pezzab commented Jun 2, 2014

Nice one. Cheers for the heads up :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants