paolomax

Untitled

Dec 3rd, 2021
551
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   mounted() {
  2.     // const login = { email : 'paolo.veneziani@hotmail.com', password: 'adminadmin'};
  3.     // let config = { headers: {Authorization: `Bearer ${this.myToken}`}};
  4.     // let bodyParameters = {key: "value"};
  5.  
  6.     // axios.post('http://127.0.0.1:8000/api/login', login).then(response => {
  7.     //   console.log(response);
  8.     //   this.myToken = response.data.data.token;
  9.     // }).then(axios.get('http://127.0.0.1:8000/api/users', bodyParameters,config)).then(response => console.log(response));
  10.  
  11.     let myToken =
  12.       "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZmFhMDQ0NmI3MTljYWNkMjdjM2FhYzZmZDZhNjdhMmNhOTJlODdkNjc3Mjc2YzdkY2ViYjg2YTAxNWRiZWU2Yjk3MzE0OTg5NzViMDU5ZDQiLCJpYXQiOjE2Mzg1NDU1OTQuNzA4NzY1LCJuYmYiOjE2Mzg1NDU1OTQuNzA4NzY5LCJleHAiOjE2NzAwODE1OTQuNzAwMywic3ViIjoiMSIsInNjb3BlcyI6WyJhZG1pbi1zY29wZSJdfQ.IPmdwtTTNVgU9tJpLfUniElEysP8_fJSZDmUEawB2_Pjd1-S03k8HyENlEznfE5oZiLOMTqPyGdFkLg2D8TFxy-6L_dScvXx0HJAKjZXFiDZUKQPtTSeksehL_eVRmjcqFKpHvMLO2ndhjcXEHJuAxMt8Ndn2m1tngxtWy2iO4N3b0dZIqsaF3zMivbzh86WO7hrPYPPR7DUp521uLtMGLHiPyrlXXqdeZ8-EIy3o5LJ1WPVdJr07kKNGyOnOZ-KF1vaQaLckS24Nhw4ZRA2fonkoQu1eArfmETOoNL3qJ0wQUJ5Qe0nfJu_oD7CjBJ9NtZTZGG14lVKFtVbjoPyLDprbbtwp70iEF-wY2U2BrxKEoeqNRgcI9yfZS2Z-Xs4UZ2JzZn_XJoWtNmYyNo0DFa_cIAKlgy1QcbHQnY0pjHWLAS24jYgHK04Ssfz8ckk4Uyoy_y2ZurRrJMeTnWE6YxJlemZZhcerer1KMuRZ9Pi9JP0uEy-PpfVa9rT3FeCHJkZLYmETMAS_K9ocFP4yvcu1c9mJ9ANsPrNnEAp0ZBNlQB44UcwzxwgTfm_f8kjwUk-y2zxl7lG0Jmpzaxyv2A4R7iApeaZHdVrFCeR2daFLCVoSlN6L-PR3gOTFCTb2guFUrfxmru5PgGHwG3dPqsuKyEbAs8FxPh1H9VmGms";
  13.  
  14.     // const config = { headers: { Authorization: `Bearer ${myToken}` } };
  15.     // const bodyParameters = { key: "value" };
  16.     axios
  17.       .get("http://127.0.0.1:8000/api/users", {
  18.         headers: { Authorization: `Bearer ${myToken}` },
  19.       })
  20.       .then((response) => console.log(response))
  21.       .catch((error) => console.log(error));
  22.   },
RAW Paste Data