Code Monkey home page Code Monkey logo

fetch-api's Introduction

Fetch API - Dog Info

Using the Fetch API to get a information on dogs from the Dog API.

Tech & Dependencies

Install & Run

  • Download zip file and install
  • Open index.html in a browser

Notes

  • The Fetch API is native to the browser
  • Using the Fetch API is simpler than using AJAX, XHR or JQuery
  • Asynchronous means to update a webpage with information from the server without doing a complete re-page load.
  • Fetch API uses JavaScript Promises to handle the results returned from the server.
  • Asynchronous JavaScript And XML (AJAX) uses XML Http Request (XHR) object to request data from a web server.
  • Fetch method, fetch('myapi.com/endpoint)
    fetch('https://dog.ceo/api/breeds/image/random')
  • Get the data with fetch(), then convert it to a json file, then log the message endpoint to the console.
fetch('https://dog.ceo/api/breeds/image/random')
    .then(response => response.json())      
    .then(data => console.log(data.message))

Sources

fetch-api's People

Contributors

edwardrutz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.