[Vuejs]-How to get data from URI in js in a synchronous way

0👍

I don’t understand what is the purpose with Vue here, but you if you want to make an http request you can do it with vue-axios package and assign the result of your http request to reactive property

0👍

So, I found how to do :

var request = require('sync-request');
var res = request('POST', 'http://MyAPIIP/connect?mail='+this.model.email+'&pass='+this.model.password);
reponse = String(JSON.parse(res.body)[0]['rep']);
console.log(reponse);

Leave a comment