{"id":69823,"date":"2022-05-08T08:00:59","date_gmt":"2022-05-08T06:00:59","guid":{"rendered":"https:\/\/drafts.code-maze.com\/?p=69823"},"modified":"2022-05-08T08:37:59","modified_gmt":"2022-05-08T06:37:59","slug":"copy-entire-directory-charp","status":"publish","type":"post","link":"https:\/\/code-maze.com\/copy-entire-directory-charp\/","title":{"rendered":"Copy the Entire Contents of a Directory in C#"},"content":{"rendered":"<p>In .NET, there is no built-in way to copy the entire contents of a directory including subfolders and their content. In this article, we will explore a clean, platform-agnostic solution for this operation. Additionally, we will see how we can implement this in the context of our projects seamlessly.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/files-csharp\/CopyAllContentInDirectory\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s dive in.<\/p>\n<h2>How to Copy a Directory Contents to Another Directory?<\/h2>\n<p>First, let&#8217;s review how we want to approach the problem before we code. Since we are trying to do a deep copy of a directory we want to make sure all directories exist before we copy files. Then we are free to copy all files from the source path to the destination path.<\/p>\n<p>We start by creating a directory at the <code>destinationDir<\/code>\u00a0path for each directory and sub-directory under the <code>sourceDir<\/code> path. Note that <code>GetDirectories()<\/code> returns sub-directories only because we specified\u00a0 <code>SearchOption.AllDirectories<\/code> and a wildcard search pattern <code>*<\/code>.<\/p>\n<p>Now, let&#8217;s take a look at how we can implement this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var allDirectories = Directory.GetDirectories(sourceDir, \"*\", SearchOption.AllDirectories)\r\n\r\nforeach (string dir in allDirectories) \r\n{ \r\n    string dirToCreate = dir.Replace(sourceDir, destinationDir); \r\n    Directory.CreateDirectory(dirToCreate); \r\n}<\/pre>\n<p>Now that all directories are created, we can copy all files in all directories. Similarly, <code>GetFiles()<\/code> returns all files in all directories because we specified <code>SearchOption.AllDirectories<\/code> and a file wild card search pattern <code>*.*<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var allFiles = Directory.GetFiles(sourceDir, \"*.*\", SearchOption.AllDirectories);\r\n\r\nforeach (string newPath in allFiles) \r\n{\r\n    File.Copy(newPath, newPath.Replace(sourceDir, destinationDir), overwriteFiles); \r\n} <\/pre>\n<p>This solution is safe to run even if a directory or file already exists at the target location. Furthermore, by setting the <code>overwriteFiles<\/code> parameter we can indicate to <code>File.Copy()<\/code> if you want to overwrite files that already exist.<\/p>\n<p>Lastly, let&#8217;s explore <code>SearchOptions<\/code> enum. In this solution, we are using <code>AllDirectories<\/code> since we want to copy all content under the <code>sourceDir<\/code> . The other option is <code>SearchOption.TopDirectoryOnly<\/code> which indicates operations should only occur under <code>sourceDir<\/code> and no other child directory.<\/p>\n<h2>Copy a Directory as DirectoryInfo Class Extension Method<\/h2>\n<p>In this section, we will add <code>DeepCopy()<\/code> as an extension method of the <code>DirectoryInfo<\/code> class. This is a great way to integrate the deep copy operation into a legacy .NET class already used to deal with directories.<\/p>\n<p>Let&#8217;s start by creating a class with an extension method <code>DeepCopy()<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static class DirectoryInfoExtensions \r\n{ \r\n    public static void DeepCopy(this DirectoryInfo directory, string destinationDir) \r\n    { \r\n        foreach (string dir in Directory.GetDirectories(directory.FullName, \"*\", SearchOption.AllDirectories)) \r\n        {\r\n            string dirToCreate = dir.Replace(directory.FullName, destinationDir); \r\n            Directory.CreateDirectory(dirToCreate); \r\n        } \r\n            \r\n        foreach (string newPath in Directory.GetFiles(directory.FullName, \"*.*\", SearchOption.AllDirectories)) \r\n        { \r\n            File.Copy(newPath, newPath.Replace(directory.FullName, destinationDir), true); \r\n        } \r\n    } \r\n}<\/pre>\n<p>Now we can import the namespace that contains our code and use the method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var sourceDir = new DirectoryInfo(sourcePath);\r\nsourceDir.DeepCopy(destinationPath, true);<\/pre>\n<p>Note that in this example of the solution we do not need the source directory path as a string in <code>DeepCopy()<\/code>. We can access this same value by referencing the <code>DirectoryInfo.FullName<\/code> property.<\/p>\n<h2>A Few Edge Cases to Consider<\/h2>\n<p>Let&#8217;s take a look at some common exceptions we may run into running this code.<\/p>\n<p>First, we may see <code>UnauthorizedAccessException<\/code> this may occur during any file system operation on entries that have permission restrictions. Make sure the code is run as Administrator or the current user is given permissions to the <code>sourceDir<\/code> or <code>destinationDir<\/code> to avoid permission exceptions.<\/p>\n<p>Next, let&#8217;s consider <code>IOException<\/code>. <code>IOException<\/code> may occur when the path passed to a function is a file when a directory path was expected.<\/p>\n<p>Lastly, <code>DirectoryNotFoundException<\/code> may occur when the path passed to a function does not exist or is an invalid path. Checking paths with <code>Directory.Exists()<\/code> or <code>File.Exists()<\/code> can avoid getting these exceptions.<\/p>\n<p>Of course, these are not the only exceptions that can happen and you need to check your own code for other possible edge cases.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this short article, we&#8217;ve learned how to copy a directory content to another directory. We can take this solution and apply it in many different contexts to improve our file management. Additionally, we can integrate it easily, using extension methods, into a currently existing class in our codebase that&#8217;s already doing some file management operations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In .NET, there is no built-in way to copy the entire contents of a directory including subfolders and their content. In this article, we will explore a clean, platform-agnostic solution for this operation. Additionally, we will see how we can implement this in the context of our projects seamlessly. Let&#8217;s dive in. How to Copy [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12],"tags":[10,1242,309,308],"class_list":["post-69823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","tag-net","tag-copy","tag-directory","tag-file","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Copy the Entire Contents of a Directory in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we&#039;re going to implement it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Copy the Entire Contents of a Directory in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we&#039;re going to implement it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-08T06:00:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-08T06:37:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Copy the Entire Contents of a Directory in C#\",\"datePublished\":\"2022-05-08T06:00:59+00:00\",\"dateModified\":\"2022-05-08T06:37:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\"},\"wordCount\":576,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\".NET\",\"copy\",\"Directory\",\"File\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\",\"url\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\",\"name\":\"Copy the Entire Contents of a Directory in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2022-05-08T06:00:59+00:00\",\"dateModified\":\"2022-05-08T06:37:59+00:00\",\"description\":\"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we're going to implement it.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/copy-entire-directory-charp\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/copy-entire-directory-charp\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Copy the Entire Contents of a Directory in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Copy the Entire Contents of a Directory in C# - Code Maze","description":"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we're going to implement it.","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:\/\/code-maze.com\/copy-entire-directory-charp\/","og_locale":"en_US","og_type":"article","og_title":"Copy the Entire Contents of a Directory in C# - Code Maze","og_description":"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we're going to implement it.","og_url":"https:\/\/code-maze.com\/copy-entire-directory-charp\/","og_site_name":"Code Maze","article_published_time":"2022-05-08T06:00:59+00:00","article_modified_time":"2022-05-08T06:37:59+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Copy the Entire Contents of a Directory in C#","datePublished":"2022-05-08T06:00:59+00:00","dateModified":"2022-05-08T06:37:59+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/"},"wordCount":576,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":[".NET","copy","Directory","File"],"articleSection":["C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/copy-entire-directory-charp\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/","url":"https:\/\/code-maze.com\/copy-entire-directory-charp\/","name":"Copy the Entire Contents of a Directory in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2022-05-08T06:00:59+00:00","dateModified":"2022-05-08T06:37:59+00:00","description":"In .NET, there is no built-in way to copy all contents of a directory including subfolders and their content so we're going to implement it.","breadcrumb":{"@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/copy-entire-directory-charp\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/copy-entire-directory-charp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Copy the Entire Contents of a Directory in C#"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/69823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=69823"}],"version-history":[{"count":5,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/69823\/revisions"}],"predecessor-version":[{"id":69924,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/69823\/revisions\/69924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=69823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=69823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=69823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}