I am trying to create a droplet via a curl call from window 10. I have installed curl and it works by itself.
The command I am trying to use is
curl -X POST -H ‘Content-Type: application/json’ \ -H ‘Authorization: Bearer $TOKEN’ -d \ ‘{“name”:“blah”,“region”:“nyc3”,“size”:“s-1vcpu-1gb”,“image”: “codenodejs-April-30”}’ \ “https://api.digitalocean.com/v2/droplets”
I want to create the droplet from a snapshot. End goal is to create something for quick deployment of images.
I took the command found in the API docs and only changed the token and the image name. I want to add monitoring too but can’t even get a droplet without monitoring to work right.
Here is the error message I get
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: Bearer
curl: (6) Could not resolve host: TOKEN’
curl: (3) [globbing] unmatched brace in column 2
curl: (3) [globbing] unmatched close brace/bracket in column 20
curl: (6) Could not resolve host:
{“id”: “unauthorized”, “message”: “Unable to authenticate you.” }
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
It appears that Curl is not parsing your -H options properly and for some reason is seeing them as the target URL.
You seem to have a few \ within the command. Are these escaping line-breaks on Windows?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.