Skip to content

Instantly share code, notes, and snippets.

@iam-vipul
Created November 4, 2020 21:37
Show Gist options
  • Save iam-vipul/feb8f2c3867ef1a55f2bffeb5102fdcd to your computer and use it in GitHub Desktop.
Save iam-vipul/feb8f2c3867ef1a55f2bffeb5102fdcd to your computer and use it in GitHub Desktop.

Revisions

  1. iam-vipul created this gist Nov 4, 2020.
    13 changes: 13 additions & 0 deletions axios snippet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    const apiUrl = "http://localhost:1337/home-page";
    const headers = { "Content-Type": "application/json" };
    axios({
    url: apiUrl,
    headers: headers,
    method: "GET",
    })
    .then((response) => {
    this.data_property = response.data
    })
    .catch((err) => {
    console.log(err);
    });