Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default {
- name: 'home',
- data: function() {
- return {token: ''}
- },
- methods: {
- fetchData() {
- this.$http({
- method: 'get',
- url: 'URL_TO_SERVER',
- auth: {
- username: 'USERNAME',
- password: 'PASSWORD'
- },
- headers: {
- 'Access-Control-Allow-Origin': '*',
- credentials: 'same-origin',
- },
- withCredentials: true,
- }).then((response) => {
- console.log(response.data);
- }).catch((error) => {
- console.log('ERROR: '+ error.response.data);
- });
- }
- }
- }
Add Comment
Please, Sign In to add comment