{"id":19299,"date":"2020-07-10T16:05:47","date_gmt":"2020-07-10T23:05:47","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=19299"},"modified":"2023-12-01T03:53:50","modified_gmt":"2023-12-01T11:53:50","slug":"javascript-fetch","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/","title":{"rendered":"JavaScript Fetch: A Guide"},"content":{"rendered":"\n<p>Did you know that you can make web requests in vanilla JavaScript? That\u2019s right, you don\u2019t need to install any libraries to make a web request. That\u2019s not all: we\u2019re not talking about the old, complex XMLHttpRequest tool.<br><\/p>\n\n\n\n<p>The fetch API allows you to make Ajax requests in plain old JavaScript. It\u2019s a useful tool for retrieving data and making changes to data on a web server.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss what the fetch API is and how you can make web requests using the API. We\u2019ll talk through two examples: a GET request and a POST request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is the Fetch API?<\/h2>\n\n\n\n<p>JavaScript has been capable of sending network requests for a long time now. The XMLHTTPRequest tool provided the resources you needed to retrieve data from a server and update information from a server.<br><\/p>\n\n\n\n<p>While this tool was effective, it was also quite verbose and complicated to use. Fetch, on the other hand, is a new alternative which makes it simpler to make web requests.<br><\/p>\n\n\n\n<p>The fetch API is supported in all modern browsers. This means that once you learn how to use it, you will not have to worry about browser compatibility when making web requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Make a GET Request Using Fetch<\/h2>\n\n\n\n<p>The best way to illustrate how fetch works is by example. For this tutorial, we\u2019re going to use the web service JSONPlaceholder. This is an API that comes with pre-written dummy data that we can use to test out our web requests.<br><\/p>\n\n\n\n<p>The following code creates a GET request to retrieve the first post from JSONPlaceholder:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>fetch('https:\/\/jsonplaceholder.typicode.com\/posts\/1')\n  .then(response =&gt; response.json())\n  .then(json =&gt; console.log(json))<\/pre><\/div>\n\n\n\n<p>This code returns:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{ body: \"quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto\", id: 1, title: \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\", userId: 1 }<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. On the first line, we have used the <code>fetch()<\/code> method to initiate a web request to the JSONPlaceholder API. We\u2019ve then used the <code>.then()<\/code> method to tell our code what to do after our web request has been made.<br><\/p>\n\n\n\n<p>In our first <code>.then()<\/code> method, we convert the response returned by the API into JSON. This makes our data more readable. We use another <code>.then()<\/code> method to log the response to the console. This shows us the post with the ID 1 from the JSONPlaceholder API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Make a POST Request<\/h2>\n\n\n\n<p>GET is not the only request type you can make with the fetch API. There\u2019s also functionality that supports POST, PUT, and DELETE requests. The syntax for these is the same, so we\u2019re just going to walk through one example: how to make a POST request.<br><\/p>\n\n\n\n<p>When you\u2019re making a POST, PUT, or DELETE request, there are usually three pieces of information you need to specify:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The URL to which you are making the request.<\/li>\n\n\n\n<li>The method you are using to make the request (in this case, POST)<\/li>\n\n\n\n<li>The data you want to send to the server<\/li>\n<\/ul>\n\n\n\n<p>Here\u2019s a code snippet that would create a new comment using the JSONPlaceholder API:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const data = {\n\tname: \"Leslie Tudor\",\n\temail: \"leslie.tudor@email.com\",\n\tbody: \"This is an example post by Career Karma!\",\n\tpostId: 1\n}\nconst options = {\n\tmethod: \"POST\",\n\tbody: JSON.stringify(data),\n\theaders: {\n\t\t\"Content-Type\": \"application\/json\"\n\t}\n};\nfetch('https:\/\/jsonplaceholder.typicode.com\/comments', options)\n  .then(response =&gt; response.json())\n  .then(json =&gt; console.log(json))<\/pre><\/div>\n\n\n\n<p>Our code returns our newly-created post in JSON format:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{ body: \"This is an example post by Career Karma!\", email: \"leslie.tudor@email.com\", id: 501, name: \"Leslie Tudor\", postId: 1 }<\/pre><\/div>\n\n\n\n<p>In our code, we first declare a data object. This stores the data that we want to send over to the server. In this case, we are sending over data about a comment made by a user called Leslie Tudor.<br><\/p>\n\n\n\n<p>We then declare another object which stores the options that are associated with our fetch request. This object specifies the method we are using to make our request (POST), the data we want to send, as well as the headers we want to send.<br><\/p>\n\n\n\n<p>Finally, we use the <code>fetch()<\/code> method to actually make our request. Like in our first example, we use <code>.then()<\/code> methods to retrieve the response, convert it to JSON, then print it to the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Handle Errors Using JavaScript Fetch<\/h2>\n\n\n\n<p>It\u2019s an unfortunate fact that some web requests don\u2019t work as intended. Maybe the data is structured incorrectly, or maybe there is a server issue. It\u2019s important that we anticipate these events upfront so that we can handle them if and when they arise.<br><\/p>\n\n\n\n<p>There\u2019s a method called <code>.catch()<\/code> which you can use to catch any errors that have been returned by your code. Combined with the <code>Promise.reject()<\/code> method, you can use it to handle errors:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>fetch('https:\/\/jsonplaceholder.typicode.com\/comments\/999, options)\n  .then(response =&gt; {\n\tif (response.ok) {\n\t\tconsole.log(response.json());\n\t\treturn response.json();\n\t} else {\n\t\treturn Promise.reject({ statusText: response.statusText })\n\t}\n})\n.catch(error =&gt; console.log(\"ERROR:\", error.statusText));<\/pre><\/div>\n\n\n\n<p>This code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\"ERROR:\", \"Not Found\"<\/pre><\/div>\n\n\n\n<p>In our code, we\u2019ve used the response.ok method to check if our request has succeeded. In this example, we\u2019ve tried to retrieve a comment that does not exist, comment #999. This causes the contents of our <code>else<\/code> statement to be executed, which returns a rejected promise. This promise contains the error message returned by the JSONPlaceholder API.<br><\/p>\n\n\n\n<p>We\u2019ve then used a <code>.catch()<\/code> statement to receive this error and print it to the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The fetch API makes it easy to make web requests in JavaScript. The API is part of vanilla JavaScript so there\u2019s no need to install or reference any libraries. What\u2019s more, you can use the fetch API to make GET, POST, PUT, and DELETE requests.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to start making web requests using the fetch API like a professional developer!<\/p>\n","protected":false},"excerpt":{"rendered":"Did you know that you can make web requests in vanilla JavaScript? That\u2019s right, you don\u2019t need to install any libraries to make a web request. That\u2019s not all: we\u2019re not talking about the old, complex XMLHttpRequest tool. The fetch API allows you to make Ajax requests in plain old JavaScript. It\u2019s a useful tool&hellip;","protected":false},"author":240,"featured_media":19300,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-19299","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":"","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 Fetch: A Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.\" \/>\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-fetch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Fetch: A Guide\" \/>\n<meta property=\"og:description\" content=\"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-fetch\/\" \/>\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-07-10T23:05:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:53:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\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=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Fetch: A Guide\",\"datePublished\":\"2020-07-10T23:05:47+00:00\",\"dateModified\":\"2023-12-01T11:53:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/\"},\"wordCount\":841,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/\",\"name\":\"JavaScript Fetch: A Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg\",\"datePublished\":\"2020-07-10T23:05:47+00:00\",\"dateModified\":\"2023-12-01T11:53:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg\",\"width\":1020,\"height\":707},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-fetch\\\/#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 Fetch: A Guide\"}]},{\"@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\\\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/jamesgallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JavaScript Fetch: A Guide | Career Karma","description":"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.","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-fetch\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Fetch: A Guide","og_description":"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-10T23:05:47+00:00","article_modified_time":"2023-12-01T11:53:50+00:00","og_image":[{"width":1020,"height":707,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Fetch: A Guide","datePublished":"2020-07-10T23:05:47+00:00","dateModified":"2023-12-01T11:53:50+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/"},"wordCount":841,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-fetch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/","url":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/","name":"JavaScript Fetch: A Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg","datePublished":"2020-07-10T23:05:47+00:00","dateModified":"2023-12-01T11:53:50+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The fetch API allows you to make web requests in vanilla JavaScript. On Career Karma, learn how to make GET, POST, PUT, and DELETE requests using fetch.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-fetch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/fabian-grohs-Y2m8QfYlpPY-unsplash.jpg","width":1020,"height":707},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-fetch\/#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 Fetch: A Guide"}]},{"@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\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19299","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\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=19299"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19299\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/19300"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=19299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=19299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=19299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}