{"id":24466,"date":"2020-10-19T09:26:51","date_gmt":"2020-10-19T16:26:51","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=24466"},"modified":"2020-10-19T09:26:53","modified_gmt":"2020-10-19T16:26:53","slug":"javascript-get-request","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/","title":{"rendered":"JavaScript GET Request: Using the Fetch API"},"content":{"rendered":"\n<p>Developers often have to retrieve data from their own API or third-party API. This article talks about using your browser\u2019s Fetch API to GET some data from an endpoint.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the Fetch API?&nbsp;<\/h2>\n\n\n\n<p>The Fetch API is an interface that allows us to make HTTP Requests to a server from a web browser like Chrome or Firefox. A GET request hits an endpoint on a server then returns a response with data from that endpoint so you can read it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Types of requests<\/h3>\n\n\n\n<p>The GET HTTP Request is only one type of request you can make to a server. Other types of requests are POST, PUT, and DELETE. These requests make a CRUD application. It is where we can Create (POST), Read (GET), Update (PUT), and Destroy (DELETE) data in our database.<br><\/p>\n\n\n\n<p>In addition, we can hit endpoints on third party APIs. Depending on the API, you\u2019ll only be allowed to perform certain requests, mainly to keep their data immutable, so you won\u2019t be able to do those requests that manipulate data, you\u2019ll only be able to read it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does Fetch API work?<\/h2>\n\n\n\n<p>The Fetch API uses a Promise-based system of communication. As a reminder, Promises are asynchronous functions that encapsulate logic into its block of code and returns a response that determines if the promise was resolved or rejected.<br><\/p>\n\n\n\n<p>As users of the Fetch API, we don\u2019t need to actually write the promise logic. We just have to use it to send a request and the Fetch API returns a promise under the hood. Here\u2019s the basic syntax so we can get the response:<br><\/p>\n\n\n\n<p><strong>promise.then(response).then(json).catch(error);<\/strong><br><\/p>\n\n\n\n<p>The promise is the actual asynchronous request. The <code>fetch()<\/code> method is available in the global scope and is passed the endpoint we want to make the HTTP request to.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let promise = fetch(&quot;https:\/\/swapi.dev\/api\/films\/1&quot;);<\/pre><\/div>\n\n\n\n<p>After the request, we can either use promise syntax with then and catch or use async\/await function to get the server\u2019s response.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Promise syntax<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>promise.then(response =&gt; {\n       if (response.status !== 200) {\n           console.log('Looks like there was a problem. Status Code: ' +\n             response.status);\n           return;\n       }\n           response.json().then(data =&gt; {\n               console.log(data);\n           }).catch(error =&gt; {\n               console.log(error.message);\n           })\n \n \n      \n     })<\/pre><\/div>\n\n\n\n<p>Here we take the promise then wait for a response. When we get a response, if the status code is anything other than 200, we log an error code to our console and terminate the function.<br><\/p>\n\n\n\n<p>Otherwise, to make the response readable so our frontend website can use it, we change it to JavaScript Object Notation (JSON) object with the <code>json()<\/code> method. We want this to evaluate first before moving on, so we chain on a promise to the previous promise.<br><\/p>\n\n\n\n<p>Once that is evaluated we can then log what was passed in to see it on our console. If you are following along, you should get something like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\n       title: 'A New Hope',\n       episode_id: 4,\n       opening_crawl: 'It is a period of civil war.\\r\\n' +\n         'Rebel spaceships, striking\\r\\n' +\n         'from a hidden base, have won\\r\\n' +\n         'their first victory against\\r\\n' +\n         'the evil Galactic Empire.\\r\\n' +\n         '\\r\\n' +\n         'During the battle, Rebel\\r\\n' +\n         'spies managed to steal secret\\r\\n' +\n         &quot;plans to the Empire's\\r\\n&quot; +\n         'ultimate weapon, the DEATH\\r\\n' +\n         'STAR, an armored space\\r\\n' +\n         'station with enough power\\r\\n' +\n         'to destroy an entire planet.\\r\\n' +\n         '\\r\\n' +\n         &quot;Pursued by the Empire's\\r\\n&quot; +\n         'sinister agents, Princess\\r\\n' +\n         'Leia races home aboard her\\r\\n' +\n         'starship, custodian of the\\r\\n' +\n         'stolen plans that can save her\\r\\n' +\n         'people and restore\\r\\n' +\n         'freedom to the galaxy....',\n       director: 'George Lucas',\n       producer: 'Gary Kurtz, Rick McCallum',\n       release_date: '1977-05-25',\n       characters: [\n         'http:\/\/swapi.dev\/api\/people\/1\/',\n         'http:\/\/swapi.dev\/api\/people\/2\/',\n         'http:\/\/swapi.dev\/api\/people\/3\/',\n         'http:\/\/swapi.dev\/api\/people\/4\/',\n         'http:\/\/swapi.dev\/api\/people\/5\/',\n         'http:\/\/swapi.dev\/api\/people\/6\/',\n         'http:\/\/swapi.dev\/api\/people\/7\/',\n         'http:\/\/swapi.dev\/api\/people\/8\/',\n         'http:\/\/swapi.dev\/api\/people\/9\/',\n         'http:\/\/swapi.dev\/api\/people\/10\/',\n         'http:\/\/swapi.dev\/api\/people\/12\/',\n         'http:\/\/swapi.dev\/api\/people\/13\/',\n         'http:\/\/swapi.dev\/api\/people\/14\/',\n         'http:\/\/swapi.dev\/api\/people\/15\/',\n         'http:\/\/swapi.dev\/api\/people\/16\/',\n         'http:\/\/swapi.dev\/api\/people\/18\/',\n         'http:\/\/swapi.dev\/api\/people\/19\/',\n         'http:\/\/swapi.dev\/api\/people\/81\/'\n       ],\n       planets: [\n         'http:\/\/swapi.dev\/api\/planets\/1\/',\n         'http:\/\/swapi.dev\/api\/planets\/2\/',\n         'http:\/\/swapi.dev\/api\/planets\/3\/'\n       ],\n       starships: [\n         'http:\/\/swapi.dev\/api\/starships\/2\/',\n         'http:\/\/swapi.dev\/api\/starships\/3\/',\n         'http:\/\/swapi.dev\/api\/starships\/5\/',\n         'http:\/\/swapi.dev\/api\/starships\/9\/',\n         'http:\/\/swapi.dev\/api\/starships\/10\/',\n         'http:\/\/swapi.dev\/api\/starships\/11\/',\n         'http:\/\/swapi.dev\/api\/starships\/12\/',\n         'http:\/\/swapi.dev\/api\/starships\/13\/'\n       ],\n       vehicles: [\n         'http:\/\/swapi.dev\/api\/vehicles\/4\/',\n         'http:\/\/swapi.dev\/api\/vehicles\/6\/',\n         'http:\/\/swapi.dev\/api\/vehicles\/7\/',\n         'http:\/\/swapi.dev\/api\/vehicles\/8\/'\n       ],\n       species: [\n         'http:\/\/swapi.dev\/api\/species\/1\/',\n         'http:\/\/swapi.dev\/api\/species\/2\/',\n         'http:\/\/swapi.dev\/api\/species\/3\/',\n         'http:\/\/swapi.dev\/api\/species\/4\/',\n         'http:\/\/swapi.dev\/api\/species\/5\/'\n       ],\n       created: '2014-12-10T14:23:31.880000Z',\n       edited: '2014-12-20T19:49:45.256000Z',\n       url: 'http:\/\/swapi.dev\/api\/films\/1\/'\n     }<\/pre><\/div>\n\n\n\n<p>If we get this information on the frontend, we can use it to populate cards or a table or however we would like to display it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Async\/Await<\/h3>\n\n\n\n<p>We can also use the async\/await function to log the same result.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let getRequest = async () =&gt; {\n   try {\n       let fetched = await fetch(&quot;http:\/\/swapi.dev\/api\/films\/1&quot;);\n       if(fetched) {\n           let read = await fetched.json()\n           console.log(read);\n           return read;\n       }\n   }\n   catch (error) {\n       throw new Error(error.message);\n   }\n}\n \ngetRequest()<\/pre><\/div>\n\n\n\n<p>The <code>async<\/code> keyword tells us that some portion of that function will be asynchronous. When we come to the await keyword, execution of the script pauses until that line of code is evaluated.<br><\/p>\n\n\n\n<p>We have two <code>await<\/code> statements in this function, comparable to the two <code>then()<\/code> statements we had in the promise logic. One statement waits for the fetching to happen at the URL we passed in, and the other waits until the fetched information has been parsed into JSON. We use <code>try\/catch<\/code> to catch any errors we may get if something unusual comes back from the responses.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final notes<\/h2>\n\n\n\n<p>For the Fetch API to work in the node environment (i.e. if you are using an IDE like Visual Studio Code), you will need to <code>yarn add<\/code> or <code>npm install node-fetch<\/code>, as fetch only works in the browser environment.<\/p>\n","protected":false},"excerpt":{"rendered":"Developers often have to retrieve data from their own API or third-party API. This article talks about using your browser\u2019s Fetch API to GET some data from an endpoint. What is the Fetch API?&nbsp; The Fetch API is an interface that allows us to make HTTP Requests to a server from a web browser like&hellip;","protected":false},"author":77,"featured_media":24468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-24466","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":[]},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>JavaScript GET Request Using the Fetch API | Career Karma<\/title>\n<meta name=\"description\" content=\"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-get-request\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript GET Request: Using the Fetch API\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-get-request\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-19T16:26:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-19T16:26:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Christina Kopecky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christina Kopecky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/\"},\"author\":{\"name\":\"Christina Kopecky\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"headline\":\"JavaScript GET Request: Using the Fetch API\",\"datePublished\":\"2020-10-19T16:26:51+00:00\",\"dateModified\":\"2020-10-19T16:26:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/\"},\"wordCount\":622,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/\",\"name\":\"JavaScript GET Request Using the Fetch API | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg\",\"datePublished\":\"2020-10-19T16:26:51+00:00\",\"dateModified\":\"2020-10-19T16:26:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"description\":\"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg\",\"width\":1020,\"height\":680,\"caption\":\"dog fetching stick\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-get-request\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript GET Request: Using the Fetch API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\",\"name\":\"Christina Kopecky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"caption\":\"Christina Kopecky\"},\"description\":\"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.\",\"sameAs\":[\"http:\\\/\\\/www.linkedin.com\\\/in\\\/cmvnk\"],\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/christina-kopecky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JavaScript GET Request Using the Fetch API | Career Karma","description":"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript GET Request: Using the Fetch API","og_description":"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma","og_url":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-10-19T16:26:51+00:00","article_modified_time":"2020-10-19T16:26:53+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg","type":"image\/jpeg"}],"author":"Christina Kopecky","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"Christina Kopecky","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/"},"author":{"name":"Christina Kopecky","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"headline":"JavaScript GET Request: Using the Fetch API","datePublished":"2020-10-19T16:26:51+00:00","dateModified":"2020-10-19T16:26:53+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/"},"wordCount":622,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-get-request\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/","url":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/","name":"JavaScript GET Request Using the Fetch API | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg","datePublished":"2020-10-19T16:26:51+00:00","dateModified":"2020-10-19T16:26:53+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"description":"Learn how to use the Fetch API to send a GET request to an API to retrieve some data on Career Karma","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-get-request\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/mitchell-orr-Pzu9f6Nby5w-unsplash.jpg","width":1020,"height":680,"caption":"dog fetching stick"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-get-request\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript GET Request: Using the Fetch API"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e","name":"Christina Kopecky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","caption":"Christina Kopecky"},"description":"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.","sameAs":["http:\/\/www.linkedin.com\/in\/cmvnk"],"url":"https:\/\/careerkarma.com\/blog\/author\/christina-kopecky\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=24466"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24466\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/24468"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=24466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=24466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=24466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}