Closed

Need help submitting post api call from vue.js to Digitalocean

Hello,

I am trying to launch a new droplet through API the same way as I've done from terminal through curl.

curl -X POST "[login to view URL]" \

-d'{"names":["[login to view URL]","[login to view URL]"],"region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-16-04-x64"}' \

-H "Authorization: Bearer $TOKEN" \

-H "Content-Type: application/json"

This works perfect from the terminal.

What I'm trying to do now is to launch it from just clicking a button in my VueJS Admin panel.

What I'm currently dealing with:

Access to XMLHttpRequest at '[login to view URL]' from origin '[login to view URL]' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is my first time trying to set up a post request to DigitalOcean. I am a bit clueless on how to add my API Key in the code as I've tried experimenting with a few options but to no avail.

I'm trying to convert the curl command in vue.js where the request sends the body information like a form or something, then when DigitalOcean receives this information, it would work the same way as the curl command works from terminal.

I will provide you with API key after.

Code is included in the attachment.

Skills: Javascript, node.js, Vue.js

See more: vue js post request, vue axios post, vue js web api, vue js api key, vue js axios, vue get data from database, vue fetch data from api, vue.js rest api, mp3 files need help transcribing, need help adding google adsense site, freelance need help wsdl file, open source projects need help, need help text website, need site can post proxy, need help post affiliate pro, using fasthost api need help, need help implementing api resellerclub, need help dutch german post classified 2009, need help paypal adaptive payment api, I need help writing a facebook post for Charlie

About the Employer:
( 0 reviews ) Makati City, Philippines

Project ID: #19257910

5 freelancers are bidding on average $37 for this job

flance9

Hi there, Thank you for sharing your requirement. Hope you are doing good and having a nice day. We are a team of technocrats having 8+ years of experience in Web and Mobile design plus development and primarily More

$35 USD in 1 day
(22 Reviews)
6.5
shingjin

Dear Hiring Manager! Wish you a very good day!!! After reviewing your post, I am very interested in that due to my experience. I’d like to be considered for your project position. I am an expert Web developer. As More

$50 USD in 1 day
(17 Reviews)
4.6
PaoloBarbolini

Hi, I have 2 years experience in Vue.js and Digitalocean and I'd like to work on this project as I know what's causing the problem.

$30 USD in 2 days
(8 Reviews)
3.8
archsoft3

"Hi, Hope you are doing well! Thanks for sharing your project requirement with us. It will be our great pleasure to work on your project. I have checked your requirement, yes we can do it, because we already work on si More

$34 USD in 7 days
(0 Reviews)
0.0
shadow55tech

its cors error please feel free to contact me to get solution here. i am expertise in Cross platform apis development

$35 USD in 1 day
(0 Reviews)
0.0