Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios

useEffect(() => {
    async function getData() {
      const options = {
        method: 'GET',
        headers: {
          Accept: 'application/json',
          Authorization: 'Bearer ' + API_KEY,
        },
      };
      const response = await axios.get(
        'http://localhost:3000/articles',
        options
      );
      setArticles(response.data);
    }
    getData();
  }, [request]);
Source by markdown-blogg.herokuapp.com #
 
PREVIOUS NEXT
Tagged: #axios
ADD COMMENT
Topic
Name
6+2 =