Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>fetch & axios snippetsNew to Visual Studio Code? Get it now.

fetch & axios snippets

Hrithik Vishwakarma

|
310 installs
| (3) | Free
Simple fetching snippets of fetch API and axios
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

fetch & axios snippets

This extension contains a collection of useful code snippets for fetching data using fetch and axios libraries in JavaScript.

Installation

  1. Open the Extensions pane in VS Code (Ctrl+Shift+X or Cmd+Shift+X on Mac).
  2. Search for "Snippets Extension" and click the "Install" button.
  3. Click the "Reload" button to activate the extension.

Usage

  1. Type the "!" of the snippet you want to use in your code.
  2. Press Tab to expand the snippet.
  3. The snippet will be automatically indented to match the current code.

Snippets

The following snippets are currently included in this extension:

Fetch

  • !fetch get: Fetches data from a specified URL using the fetch API and the GET method.
  • !fetch post: Fetches data from a specified URL using the fetch API and the POST method.
  • !fetch put: Fetches data from a specified URL using the fetch API and the PUT method.
  • !fetch delete: Fetches data from a specified URL using the fetch API and the DELETE method.
  • !fetch iifi: Fetches data from a specified URL using the fetch API with the iifi method.
  • !fetch async await: Fetches data from a specified URL using the fetch API with the async await method.

Axios

  • !axios get: Fetches data from a specified URL using the axios library and the GET method.
  • !axios post: Fetches data from a specified URL using the axios library and the POST method.
  • !axios put: Fetches data from a specified URL using the axios library and the PUT method.
  • !axios delete: Fetches data from a specified URL using the axios library and the DELETE method.
  • !axios iifi: Fetches data from a specified URL using the axios library with the iifi method.
  • !axios async await: Fetches data from a specified URL using the axios library with the async await method.

Features

fetch

!a

axios

!f

Tip: Only put '!' and see all the fetch and axios snippets

Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

  • Split the editor (Cmd+\ on macOS or Ctrl+\ on Windows and Linux).
  • Toggle preview (Shift+Cmd+V on macOS or Shift+Ctrl+V on Windows and Linux).
  • Press Ctrl+Space (Windows, Linux, macOS) to see a list of Markdown snippets.

For more information

  • Visual Studio Code's Markdown Support
  • Markdown Syntax Reference

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft