Hi, I'm trying to get this mod.io example to work. Here is a curl example they gave
curl -X POST https://api.mod.io/v1/oauth/emailrequest \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'api_key=0d0ba6756d032246f1299f8c01abc424' \ -d 'email=john.snow@westeros.com'
I'm trying to add this to my Vue JS application but it returns a 401 error. Can anyone see what's wrong?
methods: { loginUser() { const headers = { 'Content-Type': 'application/x-www-form-urlencoded', } console.log(this.email) //Works const data = { api_key: "0d0ba6756d032246f1299f8c01abc424", email: this.email } axios .post('https://api.mod.io/v1/oauth/emailrequest', data, { headers: headers }) .then(response => { console.log(response); }) .catch((error) => { console.log(error); }) }
The API and email are from the documentation, so feel free to give it a try. This is the problem I have
Could it be that my localhost doesn't have SSL?
I know I am very close to success....