{"id":15606,"date":"2019-05-13T12:28:46","date_gmt":"2019-05-13T15:28:46","guid":{"rendered":"https:\/\/blog.hostinger.io\/br-tutoriais\/?p=15606"},"modified":"2023-08-31T18:38:15","modified_gmt":"2023-08-31T21:38:15","slug":"o-que-e-json","status":"publish","type":"post","link":"\/br\/tutoriais\/o-que-e-json\/","title":{"rendered":"O que \u00e9 o que \u00e9 um arquivo JSON? Tudo o que voc\u00ea precisa saber!?"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O <\/span><strong>JSON<\/strong><span style=\"font-weight: 400\"> (JavaScript Object Notation) &eacute; um formato de arquivo para manter e trocar informa&ccedil;&otilde;es leg&iacute;veis pelas pessoas. O arquivo cont&eacute;m apenas texto e usa a extens&atilde;o <\/span><b>.json<\/b><span style=\"font-weight: 400\">.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Neste artigo, voc&ecirc; vai aprender &nbsp;sobre o JSON e para que ele &eacute; usado. Al&eacute;m disso, tamb&eacute;m vai ver como ele pode melhorar o desempenho do seu site.<\/span><\/p><p>\n\n\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-o-que-e-json-e-para-que-serve\"><b>O Que &eacute; Json e Para Que Serve<\/b><\/h2><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O JSON &eacute; um formato que armazena informa&ccedil;&otilde;es estruturadas e &eacute; principalmente usado para transferir dados entre um servidor e um cliente.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O arquivo &eacute; basicamente uma alternativa simples e mais leve ao XML (<\/span><i><span style=\"font-weight: 400\">Extensive Markup Language<\/span><\/i><span style=\"font-weight: 400\">), que tem fun&ccedil;&otilde;es similares.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Desenvolvedores usam o JSON para trabalhar com <\/span><strong><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-ajax\/\">AJAX<\/a><\/strong><span style=\"font-weight: 400\"> (<\/span><i><span style=\"font-weight: 400\">Asynchronous JavaScript and XML<\/span><\/i><span style=\"font-weight: 400\">). Esses formatos trabalham juntos para conseguir um carregamento ass&iacute;ncrono de dados armazenados.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Isso significa que um site pode atualizar suas informa&ccedil;&otilde;es sem precisar recarregar a p&aacute;gina que voc&ecirc; est&aacute; visitando.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse processo &eacute; mais f&aacute;cil de se fazer com o JSON do que em XML\/RSS. E, hoje, como v&aacute;rios sites est&atilde;o usando o AJAX, o arquivo <\/span><b>.json <\/b><span style=\"font-weight: 400\">vem se tornando muito popular.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Al&eacute;m disso, ele permite que os usu&aacute;rios pe&ccedil;am dados de <\/span>dom&iacute;nios<span style=\"font-weight: 400\"> diferentes com um m&eacute;todo chamado de <\/span><strong><a href=\"https:\/\/pt.wikipedia.org\/wiki\/JSONP\" target=\"_blank\" rel=\"noopener\">JSONP<\/a><\/strong><span style=\"font-weight: 400\"> aplicando tags <\/span><b>&lt;script&gt;.<\/b><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Caso contr&aacute;rio, voc&ecirc; n&atilde;o vai conseguir transferir dados atrav&eacute;s de dom&iacute;nios devido &agrave; <\/span><strong><a href=\"https:\/\/pt.wikipedia.org\/wiki\/Pol%C3%ADtica_de_mesma_origem\" target=\"_blank\" rel=\"noopener\">pol&iacute;tica da mesma origem<\/a><\/strong><span style=\"font-weight: 400\">.<\/span><\/p><p>\n\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Leitura Sugerida                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><a href=\"\/br\/tutoriais\/como-registrar-um-dominio\/\">Como Registrar um Dom&iacute;nio<\/a><\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-sintaxe-do-json\"><b>Sintaxe do JSON<\/b><\/h2><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Para criar corretamente o formato <\/span><b>json<\/b><span style=\"font-weight: 400\">. Voc&ecirc; tem que seguir exatamente a sua sintaxe.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Existem dois elementos centrais em um objeto JSON: <\/span><b><i>Keys<\/i><\/b><span style=\"font-weight: 400\"> (chaves) e <\/span><b><i>Values<\/i><\/b><span style=\"font-weight: 400\"> (valores).<\/span><\/p><ul class=\"wp-block-list\">\n<li><b>Keys<\/b><span style=\"font-weight: 400\"> devem ser strings (linhas). Elas cont&ecirc;m uma sequ&ecirc;ncia de caracteres cercadas por aspas.<\/span><\/li>\n\n\n\n<li><b>Values<\/b><span style=\"font-weight: 400\"> s&atilde;o um tipo v&aacute;lido de dados JSON. Eles podem ter um formato de <\/span><i><span style=\"font-weight: 400\">array, object, string, boolean, number ou null<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um objeto JSON inicia e termina com chaves <\/span><b>{}<\/b><span style=\"font-weight: 400\">. Ele tem dentro dois ou mais pares de <\/span><b>key\/value<\/b><span style=\"font-weight: 400\">, com uma<\/span><b> v&iacute;rgula<\/b><span style=\"font-weight: 400\"> para separ&aacute;-los. Cada chave &eacute; seguida por<\/span> <span style=\"font-weight: 400\">dois <\/span><b>pontos<\/b><span style=\"font-weight: 400\"> para diferenciar o valor.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Veja um exemplo:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\"city\":\"New York\", \"country\":\"United States \"}<\/pre><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Temos dois pares de key\/values aqui: <\/span><b>city<\/b><span style=\"font-weight: 400\"> e <\/span><b>country <\/b><span style=\"font-weight: 400\">s&atilde;o as keys; <\/span><b>New York<\/b><span style=\"font-weight: 400\"> e <\/span><b>United States<\/b><span style=\"font-weight: 400\"> s&atilde;o os values.<\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-tipos-de-valores\"><b>Tipos de Valores<\/b><\/h3><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Valores cont&ecirc;m um tipo v&aacute;lido de dados JSON, como:<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-array\"><b>Array<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um array &eacute; uma cole&ccedil;&atilde;o ordenada de valores. &Eacute; cercado por <strong>colchetes <\/strong><\/span><b>[]<\/b><span style=\"font-weight: 400\"> e cada valor dentro &eacute; separado por uma v&iacute;rgula.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um valor de array pode conter objetos JSON. Isso significa que ele usa o mesmo conceito de key\/value. Por exemplo:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"students\":[      \n{\"firstName\":\"Tom\", \"lastName\":\"Jackson\"},\n{\"firstName\":\"Linda\", \"lastName\":\"Garner\"},\n{\"firstName\":\"Adam\", \"lastName\":\"Cooper\"}\n]<\/pre><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">A informa&ccedil;&atilde;o entre colchetes &eacute; um array, que tem tr&ecirc;s objetos.<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-object\"><b>Object<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um objeto cont&eacute;m uma key e value. Tem dois pontos depois de cada key e uma v&iacute;rgula depois de cada value, que tamb&eacute;m diferencia cada objeto. Ambos est&atilde;o dentro de aspas.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Object, como um value, deve seguir as mesmas regras que um objeto. como:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&ldquo;employees&rdquo;: {\"firstName\":\"Tom\", \"lastName\":\"Jackson&rdquo;}<\/pre><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Aqui, <\/span><b>employees<\/b><span style=\"font-weight: 400\"> &eacute; a chave enquanto tudo dentro das chaves &eacute; um objeto.<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-strings\"><b>Strings<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Uma string &eacute; uma sequ&ecirc;ncia definida de zero ou mais caracteres Unicode. &Eacute; colocado entre duas aspas duplas.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O exemplo abaixo mostra que <\/span><b>Tom<\/b><span style=\"font-weight: 400\"> &eacute; uma string, pois &eacute; um conjunto de caracteres dentro de aspas duplas.<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"firstName\":\"Tom\"<\/pre><h4 class=\"wp-block-heading\" id=\"h-number\"><b>Number<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Number em JSON deveria ser do tipo <\/span><b>inteiro <\/b><span style=\"font-weight: 400\">ou um tipo <\/span><b>fracionado<\/b><span style=\"font-weight: 400\">, como:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{&ldquo;age&rdquo;:&rdquo;30&rdquo;}<\/pre><h4 class=\"wp-block-heading\" id=\"h-boolean\"><b>Boolean<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Voc&ecirc; pode usar as op&ccedil;&otilde;es <\/span><b>true <\/b><span style=\"font-weight: 400\">(verdadeiro) ou <\/span><b>false <\/b><span style=\"font-weight: 400\">(falso) como valor, seguindo:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{&ldquo;married&rdquo;:&rdquo;false&rdquo;)<\/pre><h4 class=\"wp-block-heading\" id=\"h-null\"><b>Null<\/b><\/h4><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse formato mostra que n&atilde;o h&aacute; informa&ccedil;&atilde;o.<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{&ldquo;bloodType&rdquo;:&rdquo;null&rdquo;}<\/pre><h2 class=\"wp-block-heading\" id=\"h-dados-json-armazenados\"><b>Dados JSON Armazenados <\/b><\/h2><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Voc&ecirc; tem duas formas de armazenar dados no JSON: <\/span><i><span style=\"font-weight: 400\">object<\/span><\/i><span style=\"font-weight: 400\"> e <\/span><i><span style=\"font-weight: 400\">array<\/span><\/i><span style=\"font-weight: 400\">. O primeiro se parece com isso:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\"firstName\":\"Tom\",\n\"lastName\":\"Jackson\",\n\"gender\":\"male\"\n}<\/pre><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">As Chaves <\/span><b>{}<\/b><span style=\"font-weight: 400\"> significam que &eacute; um objeto JSON. Elas envolvem tr&ecirc;s pares de key\/value que s&atilde;o separados por v&iacute;rgulas.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Em cada par, voc&ecirc; tem as keys (<\/span><i><span style=\"font-weight: 400\">firstName<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">lastName<\/span><\/i><span style=\"font-weight: 400\"> e <\/span><i><span style=\"font-weight: 400\">gender<\/span><\/i><span style=\"font-weight: 400\">) seguidas por dois pontos para diferenciar de outros values (<\/span><i><span style=\"font-weight: 400\">Tom<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">Jackson<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">male<\/span><\/i><span style=\"font-weight: 400\">).<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Os values nesse exemplo s&atilde;o strings. &Eacute; por isso que eles tamb&eacute;m est&atilde;o entre aspas, semelhantes &agrave;s keys.<\/span><\/p><h2 class=\"wp-block-heading\" id=\"h-usando-arrays\"><b>Usando Arrays<\/b><\/h2><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Outro m&eacute;todo de armazenamento de dados &eacute; o array. Olhe para esse exemplo:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\"firstName\":\"Tom\",\n\"lastName\":&rdquo;Jackson&rdquo;,\n&ldquo;gender&rdquo;:&rdquo;male&rdquo;,\n\"hobby\":[\"football\", \"reading\", \"swimming\"]\n}<\/pre><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O que diferencia isso do m&eacute;todo anterior &eacute; o quarto par de key\/value. <\/span><b>Hobby<\/b><span style=\"font-weight: 400\"> &eacute; a key e existem v&aacute;rios values (<\/span><i><span style=\"font-weight: 400\">football<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">reading<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">swimming<\/span><\/i><span style=\"font-weight: 400\">) entre colchetes, que representam um array.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Ele pode ser &uacute;til quando emparelhado com o JSONP para resolver o problema dos dom&iacute;nios diferentes<\/span><span style=\"font-weight: 400\">.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse processo funciona usando o que &eacute; chamado de <\/span><b>callbacks<\/b><span style=\"font-weight: 400\">, que solicitar&aacute; um item espec&iacute;fico no Array sem obter um erro da mesma origem.<\/span><\/p><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">E, finalmente, o Array tamb&eacute;m suporta o <\/span><strong><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/bash-for-loop-guia\/\">comando Loop for Bash<\/a><\/strong><span style=\"font-weight: 400\">, permitindo que voc&ecirc; execute repetidos comandos para pesquisar m&uacute;ltiplos dados. Isso torna o processo mais r&aacute;pido e mais eficaz.<\/span><\/p><figure class=\"wp-block-image size-large\"><a href=\"\/br\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-32927\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusao\"><b>Conclus&atilde;o<\/b><\/h2><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Como voc&ecirc; pode ver, a extens&atilde;o JSON &eacute; uma ferramenta &uacute;til para a troca rec&iacute;proca de dados. Ele tem muitas vantagens:<\/span><\/p><ul class=\"wp-block-list\">\n<li>Ele pode carregar informa&ccedil;&otilde;es de forma ass&iacute;ncrona para que seu site seja mais responsivo e possa lidar com o fluxo de dados com mais facilidade.<\/li>\n\n\n\n<li>Voc&ecirc; pode tamb&eacute;m us&aacute;-lo para superar problemas de <a href=\"\/br\/registro-de-dominio\">registro de dom&iacute;nio web<\/a> cruzado quando extrair informa&ccedil;&otilde;es de outro site.<\/li>\n\n\n\n<li>O JSON &eacute; simples e mais leve que o XML.<\/li>\n<\/ul><p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esperamos que voc&ecirc; tenha entendido melhor o JSON e esteja apto para gerenciar seu site de uma forma mais efetiva.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>O JSON (JavaScript Object Notation) &eacute; um formato de arquivo para manter e trocar informa&ccedil;&otilde;es leg&iacute;veis pelas pessoas. O arquivo cont&eacute;m apenas texto e usa a extens&atilde;o .json. Neste artigo, voc&ecirc; vai aprender &nbsp;sobre o JSON e para que ele &eacute; usado. Al&eacute;m disso, tamb&eacute;m vai ver como ele pode melhorar o desempenho do seu [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/br\/tutoriais\/o-que-e-json\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":92,"featured_media":15609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"rank_math_title":"%title%","rank_math_description":"Uma p\u00e1gina feita em JavaScript e que seja leg\u00edvel pelas pessoas. Aprenda o que \u00e9 JSON e como essar esse formato de texto!","rank_math_focus_keyword":"o que \u00e9 json","footnotes":""},"categories":[8077,8026],"tags":[6526,6527,4793,6525],"class_list":["post-15606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desenvolvimento-de-sites","category-sites","tag-arquivo-json","tag-formato-json","tag-javascript","tag-json"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/what-is-json\/","default":1},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-json\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/quest-ce-que-json\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/que-es-json\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/apa-itu-json\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/what-is-json\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/what-is-json\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/what-is-json\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/what-is-json\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/what-is-json\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/what-is-json\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/what-is-json\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/que-es-json\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-es-json\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-es-json\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/o-que-e-json\/","default":0}],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/comments?post=15606"}],"version-history":[{"count":11,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15606\/revisions"}],"predecessor-version":[{"id":39719,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15606\/revisions\/39719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/media\/15609"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/media?parent=15606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/categories?post=15606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/tags?post=15606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}