Closed twocow closed 6 years ago
Sure, its very easy:
curl -H "Content-Type: application/json" -X POST -d '{"page":"testpost","new_text":"hello, world"}' https://cowyo.com/update
That will change the page at https://cowyo.com/testpost
Thanks.
How do I upload a file using curl?
You should just do a curl POST to /uploads
with the file data in the form file
.
I tried and I'm failing.
curl -d "@payload.md"
Can you please give me a working example command?
With an access code set, you need to add -H 'Authorization: <access-code>'
or similar I think.
Once https://github.com/schollz/cowyo/pull/129 is merged, the login page will include (browser-invisible) instructions for curl users.
That's merged now; you should get inline instructions if you update to the latest and try again.
Thanks @DanielHeath!
I know there is the cowyodel repo. But it doesn't seem to work with access code set. And I would prefer a simpler way to POST like curl which supports authorization headers. I have tried POST-ing as a Json struct, but it doesn't seem to work. Can you please help?