Skip to content

Problem with documentation example? #283

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

3 participants

@Pezzab
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
WordPress REST API Team 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
Pezzab commented Jun 2, 2014

Nice one. Cheers for the heads up :)

@rmccue rmccue added the Has Patch label Jun 9, 2014
@rachelbaker rachelbaker closed this Jun 9, 2014
@rachelbaker rachelbaker reopened this Jun 9, 2014
@rmccue rmccue closed this in #304 Jun 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.